diff --git a/CMakeLists.txt b/CMakeLists.txt index ac02ea1..ae074c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()