From 795b8b183ec650c9c782df567607d9c83092d271 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Wed, 26 Jun 2024 16:16:34 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20gucc:=20move=20headers=20into=20?= =?UTF-8?q?separate=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- gucc/CMakeLists.txt | 12 ++++++------ gucc/{src => include/gucc}/cpu.hpp | 0 gucc/{src => include/gucc}/file_utils.hpp | 0 gucc/{src => include/gucc}/initcpio.hpp | 0 gucc/{src => include/gucc}/pacmanconf_repo.hpp | 0 gucc/{src => include/gucc}/string_utils.hpp | 0 gucc/meson.build | 2 +- gucc/src/cpu.cpp | 2 +- gucc/src/file_utils.cpp | 2 +- gucc/src/initcpio.cpp | 6 +++--- gucc/src/pacmanconf_repo.cpp | 4 ++-- gucc/src/string_utils.cpp | 2 +- gucc/tests/meson.build | 4 ++-- gucc/tests/unit-initcpio.cpp | 4 ++-- gucc/tests/unit-pacmanconf.cpp | 4 ++-- meson.build | 2 +- src/chwd_profiles.cpp | 2 +- src/crypto.cpp | 2 +- src/disk.cpp | 2 +- src/follow_process_log.cpp | 2 +- src/simple_tui.cpp | 2 +- src/tui.cpp | 2 +- src/utils.cpp | 10 +++++----- src/widgets.cpp | 4 +++- 25 files changed, 37 insertions(+), 35 deletions(-) rename gucc/{src => include/gucc}/cpu.hpp (100%) rename gucc/{src => include/gucc}/file_utils.hpp (100%) rename gucc/{src => include/gucc}/initcpio.hpp (100%) rename gucc/{src => include/gucc}/pacmanconf_repo.hpp (100%) rename gucc/{src => include/gucc}/string_utils.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b3ad1d..ca1e47b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,7 +132,7 @@ target_link_libraries(screen PRIVATE range-v3::range-v3) target_link_libraries(dom PRIVATE range-v3::range-v3) target_link_libraries(component PRIVATE range-v3::range-v3) -include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/gucc/src ${RAPIDJSON_INCLUDE_DIR}) +include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/gucc/include ${RAPIDJSON_INCLUDE_DIR}) add_subdirectory(gucc) diff --git a/gucc/CMakeLists.txt b/gucc/CMakeLists.txt index 9803d2c..debef86 100644 --- a/gucc/CMakeLists.txt +++ b/gucc/CMakeLists.txt @@ -10,17 +10,17 @@ project(gucc add_library(${PROJECT_NAME} SHARED #src/utils.cpp src/utils.hpp - src/string_utils.cpp src/string_utils.hpp - src/file_utils.cpp src/file_utils.hpp - src/cpu.cpp src/cpu.hpp - src/pacmanconf_repo.cpp src/pacmanconf_repo.hpp - src/initcpio.cpp src/initcpio.hpp + src/string_utils.cpp include/gucc/string_utils.hpp + src/file_utils.cpp include/gucc/file_utils.hpp + src/cpu.cpp include/gucc/cpu.hpp + src/pacmanconf_repo.cpp include/gucc/pacmanconf_repo.hpp + src/initcpio.cpp include/gucc/initcpio.hpp #src/chwd_profiles.cpp src/chwd_profiles.hpp #src/disk.cpp src/disk.hpp ) add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_DIR}/src) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_DIR}/include) target_link_libraries(${PROJECT_NAME} PUBLIC project_warnings project_options spdlog::spdlog fmt::fmt range-v3::range-v3) if(COS_INSTALLER_BUILD_TESTS) diff --git a/gucc/src/cpu.hpp b/gucc/include/gucc/cpu.hpp similarity index 100% rename from gucc/src/cpu.hpp rename to gucc/include/gucc/cpu.hpp diff --git a/gucc/src/file_utils.hpp b/gucc/include/gucc/file_utils.hpp similarity index 100% rename from gucc/src/file_utils.hpp rename to gucc/include/gucc/file_utils.hpp diff --git a/gucc/src/initcpio.hpp b/gucc/include/gucc/initcpio.hpp similarity index 100% rename from gucc/src/initcpio.hpp rename to gucc/include/gucc/initcpio.hpp diff --git a/gucc/src/pacmanconf_repo.hpp b/gucc/include/gucc/pacmanconf_repo.hpp similarity index 100% rename from gucc/src/pacmanconf_repo.hpp rename to gucc/include/gucc/pacmanconf_repo.hpp diff --git a/gucc/src/string_utils.hpp b/gucc/include/gucc/string_utils.hpp similarity index 100% rename from gucc/src/string_utils.hpp rename to gucc/include/gucc/string_utils.hpp diff --git a/gucc/meson.build b/gucc/meson.build index c0a5c68..96c305c 100644 --- a/gucc/meson.build +++ b/gucc/meson.build @@ -6,7 +6,7 @@ gucc_lib = library('gucc', 'src/pacmanconf_repo.cpp', 'src/initcpio.cpp', ], - include_directories : [include_directories('src')], + include_directories : [include_directories('include')], dependencies: deps ) diff --git a/gucc/src/cpu.cpp b/gucc/src/cpu.cpp index d54edf7..2072f99 100644 --- a/gucc/src/cpu.cpp +++ b/gucc/src/cpu.cpp @@ -1,4 +1,4 @@ -#include "cpu.hpp" +#include "gucc/cpu.hpp" #include // for uname diff --git a/gucc/src/file_utils.cpp b/gucc/src/file_utils.cpp index 8c89478..e8c2350 100644 --- a/gucc/src/file_utils.cpp +++ b/gucc/src/file_utils.cpp @@ -1,4 +1,4 @@ -#include "file_utils.hpp" +#include "gucc/file_utils.hpp" #include // for errno, strerror #include // for feof, fgets, pclose, perror, popen diff --git a/gucc/src/initcpio.cpp b/gucc/src/initcpio.cpp index 744ad1a..e727199 100644 --- a/gucc/src/initcpio.cpp +++ b/gucc/src/initcpio.cpp @@ -1,6 +1,6 @@ -#include "initcpio.hpp" -#include "file_utils.hpp" -#include "string_utils.hpp" +#include "gucc/initcpio.hpp" +#include "gucc/file_utils.hpp" +#include "gucc/string_utils.hpp" #include // for ofstream diff --git a/gucc/src/pacmanconf_repo.cpp b/gucc/src/pacmanconf_repo.cpp index 3ebdf93..22943d4 100644 --- a/gucc/src/pacmanconf_repo.cpp +++ b/gucc/src/pacmanconf_repo.cpp @@ -1,5 +1,5 @@ -#include "pacmanconf_repo.hpp" -#include "file_utils.hpp" +#include "gucc/pacmanconf_repo.hpp" +#include "gucc/file_utils.hpp" #include // for ofstream #include // for string diff --git a/gucc/src/string_utils.cpp b/gucc/src/string_utils.cpp index 3d9770d..e5188db 100644 --- a/gucc/src/string_utils.cpp +++ b/gucc/src/string_utils.cpp @@ -1,4 +1,4 @@ -#include "string_utils.hpp" +#include "gucc/string_utils.hpp" #if defined(__clang__) #pragma clang diagnostic push diff --git a/gucc/tests/meson.build b/gucc/tests/meson.build index 85e09d4..c98cb27 100644 --- a/gucc/tests/meson.build +++ b/gucc/tests/meson.build @@ -3,7 +3,7 @@ executable( files('unit-initcpio.cpp'), dependencies: deps, link_with: [gucc_lib], - include_directories: [include_directories('../src')], + include_directories: [include_directories('../include')], install: false) executable( @@ -11,5 +11,5 @@ executable( files('unit-pacmanconf.cpp'), dependencies: deps, link_with: [gucc_lib], - include_directories: [include_directories('../src')], + include_directories: [include_directories('../include')], install: false) diff --git a/gucc/tests/unit-initcpio.cpp b/gucc/tests/unit-initcpio.cpp index f3ab988..c29bb48 100644 --- a/gucc/tests/unit-initcpio.cpp +++ b/gucc/tests/unit-initcpio.cpp @@ -1,5 +1,5 @@ -#include "file_utils.hpp" -#include "initcpio.hpp" +#include "gucc/file_utils.hpp" +#include "gucc/initcpio.hpp" #include #include diff --git a/gucc/tests/unit-pacmanconf.cpp b/gucc/tests/unit-pacmanconf.cpp index a600e1a..ca7fb13 100644 --- a/gucc/tests/unit-pacmanconf.cpp +++ b/gucc/tests/unit-pacmanconf.cpp @@ -1,5 +1,5 @@ -#include "file_utils.hpp" -#include "pacmanconf_repo.hpp" +#include "gucc/file_utils.hpp" +#include "gucc/pacmanconf_repo.hpp" #include #include diff --git a/meson.build b/meson.build index 6d6d74b..6ea017b 100644 --- a/meson.build +++ b/meson.build @@ -170,7 +170,7 @@ executable( src_files, dependencies: deps, link_with: gucc_lib, - include_directories: [include_directories('src'), include_directories('gucc/src')], + include_directories: [include_directories('src'), include_directories('gucc/include')], install: true) install_data( diff --git a/src/chwd_profiles.cpp b/src/chwd_profiles.cpp index 8258153..abe4a41 100644 --- a/src/chwd_profiles.cpp +++ b/src/chwd_profiles.cpp @@ -2,7 +2,7 @@ #include "utils.hpp" // import gucc -#include "string_utils.hpp" +#include "gucc/string_utils.hpp" #include // for any_of, sort, for_each diff --git a/src/crypto.cpp b/src/crypto.cpp index c77bcf7..331423f 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -4,7 +4,7 @@ #include "widgets.hpp" // import gucc -#include "string_utils.hpp" +#include "gucc/string_utils.hpp" #include #include diff --git a/src/disk.cpp b/src/disk.cpp index 0573fdd..7693a31 100644 --- a/src/disk.cpp +++ b/src/disk.cpp @@ -4,7 +4,7 @@ #include "widgets.hpp" // import gucc -#include "string_utils.hpp" +#include "gucc/string_utils.hpp" #include // for exists, is_directory #include // for Renderer, Button diff --git a/src/follow_process_log.cpp b/src/follow_process_log.cpp index 11f2f86..35cfdfa 100644 --- a/src/follow_process_log.cpp +++ b/src/follow_process_log.cpp @@ -4,7 +4,7 @@ #include "widgets.hpp" // import gucc -#include "string_utils.hpp" +#include "gucc/string_utils.hpp" #include // for operator""s, chrono_literals #include // for string, operator<<, to_string diff --git a/src/simple_tui.cpp b/src/simple_tui.cpp index 12d3f01..3dd35a0 100644 --- a/src/simple_tui.cpp +++ b/src/simple_tui.cpp @@ -6,7 +6,7 @@ #include "widgets.hpp" // import gucc -#include "string_utils.hpp" +#include "gucc/string_utils.hpp" /* clang-format off */ #include // for setenv diff --git a/src/tui.cpp b/src/tui.cpp index d888b6a..850b5fe 100644 --- a/src/tui.cpp +++ b/src/tui.cpp @@ -10,7 +10,7 @@ #include "widgets.hpp" // import gucc -#include "string_utils.hpp" +#include "gucc/string_utils.hpp" #include #include diff --git a/src/utils.cpp b/src/utils.cpp index 583a132..6e88eb8 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1,16 +1,16 @@ #include "utils.hpp" #include "config.hpp" -#include "cpu.hpp" #include "definitions.hpp" -#include "initcpio.hpp" -#include "pacmanconf_repo.hpp" #include "subprocess.h" #include "tui.hpp" #include "widgets.hpp" // import gucc -#include "file_utils.hpp" -#include "string_utils.hpp" +#include "gucc/cpu.hpp" +#include "gucc/file_utils.hpp" +#include "gucc/initcpio.hpp" +#include "gucc/pacmanconf_repo.hpp" +#include "gucc/string_utils.hpp" #include // for transform #include // for array diff --git a/src/widgets.cpp b/src/widgets.cpp index 072c26a..730be75 100644 --- a/src/widgets.cpp +++ b/src/widgets.cpp @@ -1,5 +1,7 @@ #include "widgets.hpp" -#include "string_utils.hpp" // for make_multiline + +// import gucc +#include "gucc/string_utils.hpp" // for make_multiline #include // for transform #include // for size_t