Skip to content

Commit e6915f3

Browse files
Add support for legacy C test code compilation under Clang in CMake
1 parent fcb5917 commit e6915f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ add_executable(test_parity test_csv.cpp)
22
target_link_libraries(test_parity csvcpp)
33
target_include_directories(test_parity PRIVATE ${CMAKE_SOURCE_DIR}/csvcpp/include)
44

5+
# Allow legacy-style C test code to compile under clang++
6+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
7+
target_compile_options(test_parity PRIVATE -fpermissive -Wno-writable-strings)
8+
endif()
9+
510
# Enable testing
611
enable_testing()
712
add_test(NAME test_parity COMMAND test_parity)

0 commit comments

Comments
 (0)