diff --git a/cmake/CommonModules/TinyCommon.cmake b/cmake/CommonModules/TinyCommon.cmake index 1591743b0..4cef49b2d 100644 --- a/cmake/CommonModules/TinyCommon.cmake +++ b/cmake/CommonModules/TinyCommon.cmake @@ -97,12 +97,17 @@ ${TINY_UNPARSED_ARGUMENTS}") /Zc:__cplusplus # Standards-conforming behavior /Zc:strictStrings + # Enable Additional Security Checks for Debug builds only + $<$:/sdl> /W4 - # Abort compiling on warnings for Debug builds only, Release builds must go on - # as far as possible - $<$:/WX /sdl> ) + # Abort compiling on warnings for Debug builds only (excluding vcpkg), + # Release and vcpkg builds must go on as far as possible + if(NOT TINY_VCPKG) + target_compile_options(${target} INTERFACE $<$:/WX>) + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options(${target} INTERFACE # Set by default by c++20 but from VS 16.11, can be removed when @@ -161,6 +166,14 @@ ${TINY_UNPARSED_ARGUMENTS}") CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") ) + # Abort compiling on warnings for Debug builds only (excluding vcpkg), + # Release and vcpkg builds must go on as far as possible + if(NOT TINY_VCPKG) + target_compile_options(${target} INTERFACE + $<$:-Werror -Wfatal-errors -pedantic-errors> + ) + endif() + target_compile_options(${target} INTERFACE # -fexceptions for linux is not needed, it is on by default -Wall @@ -168,9 +181,6 @@ ${TINY_UNPARSED_ARGUMENTS}") # Weffc++ is outdated, it warnings about bullshits 🤬, even word about this # in docs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110186 # -Weffc++ - # Abort compiling on warnings for Debug builds only, Release builds must go on - # as far as possible - $<$:-Werror -Wfatal-errors -pedantic-errors> -pedantic -Wcast-qual -Wcast-align