diff options
Diffstat (limited to 'tests/CMakeLists.txt')
| -rw-r--r-- | tests/CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e111e33..138159d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,9 +2,6 @@ set(CMAKE_C_STANDARD 90) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_EXTENSIONS OFF) -# Enable warnings and pedantics -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic") - # Enable testing include(CTest) enable_testing() @@ -17,4 +14,11 @@ foreach(TEST_FILENAME ${TEST_FILES}) add_executable("${TEST_NAME}" ${TEST_FILENAME}) target_link_libraries("${TEST_NAME}" bhlib bhunit) add_test(NAME "${TEST_NAME}" COMMAND "${TEST_NAME}") + + # Enable warnings and pedantics + if(MSVC) + target_compile_options("${TEST_NAME}" PRIVATE /W4) + else() + target_compile_options("${TEST_NAME}" PRIVATE -Wall -Wextra -Wpedantic) + endif() endforeach() |
