diff --git a/inkcpp_cl/CMakeLists.txt b/inkcpp_cl/CMakeLists.txt index 5113573c..c9c0e338 100644 --- a/inkcpp_cl/CMakeLists.txt +++ b/inkcpp_cl/CMakeLists.txt @@ -4,5 +4,16 @@ add_executable(inkcpp_cl inkcpp_cl.cpp test.h test.cpp) # Include compiler and runtime libraries target_link_libraries(inkcpp_cl PUBLIC inkcpp inkcpp_compiler) +# For https://en.cppreference.com/w/cpp/filesystem#Notes +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.1") + target_link_libraries(inkcpp_cl PRIVATE stdc++fs) + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0") + target_link_libraries(inkcpp_cl PRIVATE stdc++fs) + endif() +endif() + # Install -install(TARGETS inkcpp_cl DESTINATION bin) \ No newline at end of file +install(TARGETS inkcpp_cl DESTINATION bin) diff --git a/inkcpp_test/CMakeLists.txt b/inkcpp_test/CMakeLists.txt index bbf43dac..dbf35ee0 100644 --- a/inkcpp_test/CMakeLists.txt +++ b/inkcpp_test/CMakeLists.txt @@ -4,13 +4,24 @@ add_executable(inkcpp_test catch.hpp Main.cpp Stack.cpp Callstack.cpp Restorable.cpp - Value.cpp - Globals.cpp - Tags.cpp + Value.cpp + Globals.cpp + Tags.cpp ) target_link_libraries(inkcpp_test PUBLIC inkcpp inkcpp_compiler) +# For https://en.cppreference.com/w/cpp/filesystem#Notes +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.1") + target_link_libraries(inkcpp_test PRIVATE stdc++fs) + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0") + target_link_libraries(inkcpp_test PRIVATE stdc++fs) + endif() +endif() + add_test(NAME UnitTests COMMAND $) set (source "${CMAKE_CURRENT_SOURCE_DIR}/ink") set (destination "${CMAKE_CURRENT_BINARY_DIR}/ink")