Enable strict compile flags
This commit is contained in:
parent
3facc3333c
commit
a9a9c6fd9e
|
@ -54,3 +54,16 @@ install(TARGETS appSolitare
|
|||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
# Enable strict compile flags for warnings
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
target_compile_options(appSolitare PRIVATE
|
||||
# Enable high-level warnings
|
||||
-Wall -Wextra -pedantic
|
||||
# Enable warnings as errors
|
||||
-Werror
|
||||
)
|
||||
elseif(MSVC)
|
||||
# For MSVC, use /W4 for strict warnings and /WX to treat warnings as errors
|
||||
target_compile_options(appSolitare PRIVATE /W4 /WX)
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue