From bd78471dae4a87a21e950880a67e032e9e15ef5e Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 24 Jun 2019 01:22:04 +0100 Subject: [PATCH] Move ini parser as well --- cmake/target_link_libraries_system.cmake | 2 +- llarp/CMakeLists.txt | 5 +++-- llarp/config/config.cpp | 2 +- llarp/{util => config}/ini.cpp | 5 +++-- llarp/{util => config}/ini.hpp | 4 +++- llarp/service/config.cpp | 2 +- test/CMakeLists.txt | 4 ++-- .../test_llarp_config_ini.cpp} | 2 +- 8 files changed, 15 insertions(+), 11 deletions(-) rename llarp/{util => config}/ini.cpp (99%) rename llarp/{util => config}/ini.hpp (99%) rename test/{util/test_llarp_util_ini.cpp => config/test_llarp_config_ini.cpp} (98%) diff --git a/cmake/target_link_libraries_system.cmake b/cmake/target_link_libraries_system.cmake index 761b7c767..eca571601 100644 --- a/cmake/target_link_libraries_system.cmake +++ b/cmake/target_link_libraries_system.cmake @@ -4,6 +4,6 @@ function(target_link_libraries_system target) foreach(lib ${libs}) get_target_property(lib_include_dirs ${lib} INTERFACE_INCLUDE_DIRECTORIES) target_include_directories(${target} SYSTEM PUBLIC ${lib_include_dirs}) - target_link_libraries(${target} ${lib}) + target_link_libraries(${target} PUBLIC ${lib}) endforeach(lib) endfunction() diff --git a/llarp/CMakeLists.txt b/llarp/CMakeLists.txt index 168ebeb49..211ca19bc 100644 --- a/llarp/CMakeLists.txt +++ b/llarp/CMakeLists.txt @@ -1,4 +1,6 @@ set(LIB_UTIL_SRC + config/config.cpp + config/ini.cpp constants/defaults.cpp constants/link_layer.cpp constants/path.cpp @@ -13,7 +15,6 @@ set(LIB_UTIL_SRC util/encode.cpp util/endian.cpp util/fs.cpp - util/ini.cpp util/json.cpp util/logger.cpp util/android_logger.cpp @@ -52,6 +53,7 @@ set(LIB_UTIL_SRC add_library(${UTIL_LIB} STATIC ${LIB_UTIL_SRC}) target_include_directories(${UTIL_LIB} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include) +target_link_libraries(${UTIL_LIB} PUBLIC ${CRYPTOGRAPHY_LIB}) target_link_libraries_system(${UTIL_LIB} absl::synchronization absl::hash absl::container nlohmann_json::nlohmann_json) # cut back on fluff @@ -125,7 +127,6 @@ set(DNSLIB_SRC set(LIB_SRC ${DNSLIB_SRC} - config/config.cpp context.cpp crypto/constants.cpp crypto/crypto_libsodium.cpp diff --git a/llarp/config/config.cpp b/llarp/config/config.cpp index ca9751107..8ac10897c 100644 --- a/llarp/config/config.cpp +++ b/llarp/config/config.cpp @@ -1,9 +1,9 @@ #include +#include #include #include #include -#include #include #include diff --git a/llarp/util/ini.cpp b/llarp/config/ini.cpp similarity index 99% rename from llarp/util/ini.cpp rename to llarp/config/ini.cpp index 0f7c4bb69..22b5d7892 100644 --- a/llarp/util/ini.cpp +++ b/llarp/config/ini.cpp @@ -1,8 +1,9 @@ -#include +#include +#include + #include #include #include -#include #ifdef LoadString #undef LoadString diff --git a/llarp/util/ini.hpp b/llarp/config/ini.hpp similarity index 99% rename from llarp/util/ini.hpp rename to llarp/config/ini.hpp index 4bd2a627b..3e7a845d1 100644 --- a/llarp/util/ini.hpp +++ b/llarp/config/ini.hpp @@ -1,9 +1,11 @@ #ifndef LOKINET_BOOTSERV_CONFIG_HPP #define LOKINET_BOOTSERV_CONFIG_HPP -#include + #include + #include #include +#include #include namespace llarp diff --git a/llarp/service/config.cpp b/llarp/service/config.cpp index 84e3a6585..fbb08a316 100644 --- a/llarp/service/config.cpp +++ b/llarp/service/config.cpp @@ -1,6 +1,6 @@ #include -#include +#include namespace llarp { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fad7fd87d..e7c0159e5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,7 @@ set(TEST_EXE testAll) list(APPEND TEST_SRC + config/test_llarp_config_ini.cpp crypto/test_llarp_crypto_types.cpp crypto/test_llarp_crypto.cpp dht/test_llarp_dht_bucket.cpp @@ -36,7 +37,6 @@ list(APPEND TEST_SRC util/test_llarp_util_bencode.cpp util/test_llarp_util_bits.cpp util/test_llarp_util_encode.cpp - util/test_llarp_util_ini.cpp util/test_llarp_util_metrics_core.cpp util/test_llarp_util_metrics_types.cpp util/test_llarp_util_memfn.cpp @@ -72,4 +72,4 @@ endif(NOT WIN32) if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") target_link_directories(${TEST_EXE} PRIVATE /usr/local/lib) -endif() \ No newline at end of file +endif() diff --git a/test/util/test_llarp_util_ini.cpp b/test/config/test_llarp_config_ini.cpp similarity index 98% rename from test/util/test_llarp_util_ini.cpp rename to test/config/test_llarp_config_ini.cpp index b3fa9947b..64081ff67 100644 --- a/test/util/test_llarp_util_ini.cpp +++ b/test/config/test_llarp_config_ini.cpp @@ -1,6 +1,6 @@ #include -#include +#include struct TestINIParser : public ::testing::Test {