Skip to content

Commit

Permalink
cmake: only add stdc++fs flags if it's an old compiler (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuree authored Jun 24, 2022
1 parent 8866ee6 commit 3f6e637
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ add_dependencies(slangcore gen_version)

if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT APPLE)
# Link against C++17 filesystem
target_link_libraries(slangcore PUBLIC stdc++fs)
if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) OR
(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0))
target_link_libraries(slangcore PUBLIC stdc++fs)
endif()
endif()

find_package(Threads)
Expand Down

0 comments on commit 3f6e637

Please sign in to comment.