1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-30 21:51:12 +02:00

add \W4 flag for test compilation

This commit is contained in:
Lars Melchior 2020-04-15 08:57:29 +02:00
parent 4897c30c47
commit ed8e6d3b19

View file

@ -40,10 +40,12 @@ file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
add_executable(GreeterTests ${sources})
target_link_libraries(GreeterTests doctest Greeter)
set_target_properties(GreeterTests PROPERTIES CXX_STANDARD 17)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set_target_properties(GreeterTests PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-Wall -pedantic -Wextra -Werror")
else()
set_target_properties(GreeterTests PROPERTIES CXX_STANDARD 17)
target_compile_options(GreeterTests PRIVATE -Wall -pedantic -Wextra -Werror)
elseif(MSVC)
target_compile_options(GreeterTests PRIVATE /W4)
endif()
# ---- Add GreeterTests ----