From bdb1df6dc64989b2b0e438c6e12faa911df806b3 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Mon, 24 Oct 2022 16:57:13 +0200 Subject: [PATCH] Switch `glob::glob` to use `ghc::filesystem`. Closes #52. --- 3rdparty/CMakeLists.txt | 2 ++ src/util/helpers.cc | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 168cdfbb..8e92820b 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -33,6 +33,8 @@ add_subdirectory(json EXCLUDE_FROM_ALL) add_subdirectory(stduuid EXCLUDE_FROM_ALL) add_subdirectory(tomlplusplus EXCLUDE_FROM_ALL) add_subdirectory(out_ptr EXCLUDE_FROM_ALL) + +option(GLOB_USE_GHC_FILESYSTEM "Use ghc::filesystem instead of std::filesystem" ON) add_subdirectory(glob EXCLUDE_FROM_ALL) set(SPDLOG_FMT_EXTERNAL ON) diff --git a/src/util/helpers.cc b/src/util/helpers.cc index ab3a0478..0b4181cb 100644 --- a/src/util/helpers.cc +++ b/src/util/helpers.cc @@ -149,11 +149,7 @@ std::vector zeek::agent::glob(const filesystem::path& pattern, if ( paths.size() > max ) paths.resize(max); - std::vector ret; - for ( const auto& path : paths ) - ret.emplace_back(path.string()); - - return ret; + return paths; } TEST_SUITE("Helpers") {