diff --git a/.gitmodules b/.gitmodules index dc334d825..cff26300f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "external/cxxopts"] path = external/cxxopts url = https://github.com/jarro2783/cxxopts.git +[submodule "external/ghc-filesystem"] + path = external/ghc-filesystem + url = https://github.com/gulrak/filesystem.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 1891ddc08..9d8287325 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,6 @@ option(WITH_COVERAGE "generate coverage data" OFF) option(USE_SHELLHOOKS "enable shell hooks on compile time (dangerous)" OFF) option(WARNINGS_AS_ERRORS "treat all warnings as errors. turn off for development, on for release" OFF) option(TRACY_ROOT "include tracy profiler source" OFF) -option(VENDOR_LIBSODIUM "use vendored libsodium" OFF) -option(VENDOR_FILESYSTEM "use vendored fs::filesystem" ON) option(WITH_TESTS "build unit tests" ON) option(WITH_SYSTEMD "enable systemd integration for sd_notify" OFF) @@ -255,15 +253,10 @@ if(SUBMODULE_CHECK) check_submodule(external/nlohmann) check_submodule(external/googletest) check_submodule(external/cxxopts) + check_submodule(external/ghc-filesystem) endif() endif() -if(VENDOR_FILESYSTEM) - include_directories("${CMAKE_CURRENT_LIST_DIR}/vendor/ghc-filesystem/include") - add_definitions(-DLOKINET_USE_GHC_FILESYSTEM) - message(STATUS "Using vendored ghc::filesystem") -endif() - if(WITH_TESTS) add_subdirectory(external/googletest EXCLUDE_FROM_ALL) endif() @@ -272,6 +265,7 @@ add_subdirectory(external/abseil-cpp EXCLUDE_FROM_ALL) set(JSON_BuildTests OFF CACHE INTERNAL "") add_subdirectory(external/nlohmann EXCLUDE_FROM_ALL) add_subdirectory(external/cxxopts) +add_subdirectory(external/ghc-filesystem) if(ANDROID) list(APPEND LIBS log) diff --git a/external/ghc-filesystem b/external/ghc-filesystem new file mode 160000 index 000000000..c428aba39 --- /dev/null +++ b/external/ghc-filesystem @@ -0,0 +1 @@ +Subproject commit c428aba39d5829c4bac420edd2319f8c993f203a diff --git a/llarp/CMakeLists.txt b/llarp/CMakeLists.txt index 5ad23e7a0..60ce388e9 100644 --- a/llarp/CMakeLists.txt +++ b/llarp/CMakeLists.txt @@ -72,6 +72,7 @@ target_link_libraries(${UTIL_LIB} PUBLIC ${CRYPTOGRAPHY_LIB} ${LOG_LIB} ${CURL_L target_link_libraries(${UTIL_LIB} PUBLIC absl::synchronization absl::flat_hash_map absl::container nlohmann_json::nlohmann_json + ghc_filesystem ) # cut back on fluff diff --git a/llarp/util/fs.hpp b/llarp/util/fs.hpp index 69559bc7d..002270ca3 100644 --- a/llarp/util/fs.hpp +++ b/llarp/util/fs.hpp @@ -9,16 +9,8 @@ #define PATH_SEP "/" #endif -#if defined(LOKINET_USE_GHC_FILESYSTEM) #include namespace fs = ghc::filesystem; -#elif __cplusplus >= 201703L && !defined(_MSC_VER) -#include -namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif #ifndef _MSC_VER #include