From 612f4584b666530b4f4fb0fe1fdab9d56e9eb476 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 Dec 2021 13:19:48 -0500 Subject: [PATCH] fix: add WASI build support (#679) Addresses: wasm-ld: error: CMakeFiles/WebAssemblyInterfaceHeaderTest1.dir/test/WebAssemblyInterfaceHeaderTest1.cxx.o: undefined symbol: std::__2::__fs::filesystem::__status(std::__2::__fs::filesystem::path const&, std::__2::error_code*) /usr/wasi-sdk-14.0/share/wasi-sysroot/include/c++/v1/filesystem:256:3: error: "The Filesystem library is not supported by this configuration of libc++" # error "The Filesystem library is not supported by this configuration of libc++" --- include/CLI/Validators.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/CLI/Validators.hpp b/include/CLI/Validators.hpp index 03eb77b6..ba3cbe3c 100644 --- a/include/CLI/Validators.hpp +++ b/include/CLI/Validators.hpp @@ -32,6 +32,9 @@ // Filesystem cannot be used if targeting macOS < 10.15 #if defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 #define CLI11_HAS_FILESYSTEM 0 +#elif defined(__wasi__) +// As of wasi-sdk-14, filesystem is not implemented +#define CLI11_HAS_FILESYSTEM 0 #else #include #if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703