Skip to content

Commit d354b7e

Browse files
committed
Fix linking error std::fs for clang-8
1 parent 09fb839 commit d354b7e

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/CMakeLists.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,28 @@ function(make_test target)
4747
endfunction()
4848

4949
make_test(distance)
50-
make_test(dump)
50+
51+
project(test_dump)
52+
53+
add_executable(${PROJECT_NAME}
54+
${PROJECT_NAME}.cpp
55+
)
56+
57+
if(CMAKE_CXX_COMPILER_ID MATCHES "[cC][lL][aA][nN][gG]" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
58+
set(${PROJECT_NAME}_libs stdc++fs)
59+
endif()
60+
61+
target_link_libraries(${PROJECT_NAME}
62+
PRIVATE
63+
SQLite::Functions
64+
GTest::gtest_main
65+
${${PROJECT_NAME}_libs}
66+
)
67+
68+
gtest_add_tests(${PROJECT_NAME}
69+
SOURCES ${PROJECT_NAME}.cpp
70+
)
71+
5172
make_test(transliteration)
5273

5374
include(${CMAKE}/sanitizer_options.cmake)

0 commit comments

Comments
 (0)