Skip to content

Commit 7c55a1a

Browse files
authored
Merge pull request #33 from mbrunnen/master
Fix build errors due to missing dependency stdc++fs
2 parents 2e8b94d + f84ec24 commit 7c55a1a

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

inkcpp_cl/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,16 @@ add_executable(inkcpp_cl inkcpp_cl.cpp test.h test.cpp)
44
# Include compiler and runtime libraries
55
target_link_libraries(inkcpp_cl PUBLIC inkcpp inkcpp_compiler)
66

7+
# For https://en.cppreference.com/w/cpp/filesystem#Notes
8+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
9+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.1")
10+
target_link_libraries(inkcpp_cl PRIVATE stdc++fs)
11+
endif()
12+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
13+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
14+
target_link_libraries(inkcpp_cl PRIVATE stdc++fs)
15+
endif()
16+
endif()
17+
718
# Install
8-
install(TARGETS inkcpp_cl DESTINATION bin)
19+
install(TARGETS inkcpp_cl DESTINATION bin)

inkcpp_test/CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@ add_executable(inkcpp_test catch.hpp Main.cpp
44
Stack.cpp
55
Callstack.cpp
66
Restorable.cpp
7-
Value.cpp
8-
Globals.cpp
9-
Tags.cpp
7+
Value.cpp
8+
Globals.cpp
9+
Tags.cpp
1010
)
1111

1212
target_link_libraries(inkcpp_test PUBLIC inkcpp inkcpp_compiler)
1313

14+
# For https://en.cppreference.com/w/cpp/filesystem#Notes
15+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
16+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.1")
17+
target_link_libraries(inkcpp_test PRIVATE stdc++fs)
18+
endif()
19+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
20+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
21+
target_link_libraries(inkcpp_test PRIVATE stdc++fs)
22+
endif()
23+
endif()
24+
1425
add_test(NAME UnitTests COMMAND $<TARGET_FILE:inkcpp_test>)
1526
set (source "${CMAKE_CURRENT_SOURCE_DIR}/ink")
1627
set (destination "${CMAKE_CURRENT_BINARY_DIR}/ink")

0 commit comments

Comments
 (0)