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:
parent
4897c30c47
commit
ed8e6d3b19
1 changed files with 5 additions and 3 deletions
|
@ -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 ----
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue