diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0bfbb32..6c0884e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,7 +23,12 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND (CMAKE_CXX_COMPILER_VERSION add_executable(std_filesystem_test filesystem_test.cpp catch.hpp) set_property(TARGET std_filesystem_test PROPERTY CXX_STANDARD 17) target_compile_definitions(std_filesystem_test PRIVATE USE_STD_FS) - target_link_libraries(std_filesystem_test -lc++fs) + if(APPLE) + target_link_libraries(std_filesystem_test -lc++fs) + else() + add_compile_options("-stdlib=libc++") + target_link_libraries(std_filesystem_test -lc++fs) + endif() endif() if (CMAKE_COMPILER_IS_GNUCXX AND (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)) add_executable(std_filesystem_test filesystem_test.cpp catch.hpp)