Skip to content

Commit

Permalink
vcpkg don't abort compiling on warnings
Browse files Browse the repository at this point in the history
Abort compiling on warnings for Debug builds only (excluding vcpkg),
Release and vcpkg builds must go on as far as possible.
  • Loading branch information
silverqx committed May 1, 2024
1 parent b77841d commit 7f4c5d7
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions cmake/CommonModules/TinyCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,17 @@ ${TINY_UNPARSED_ARGUMENTS}")
/Zc:__cplusplus
# Standards-conforming behavior
/Zc:strictStrings
# Enable Additional Security Checks for Debug builds only
$<$<CONFIG:Debug>:/sdl>
/W4
# Abort compiling on warnings for Debug builds only, Release builds must go on
# as far as possible
$<$<CONFIG:Debug>:/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 $<$<CONFIG:Debug>:/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
Expand Down Expand Up @@ -161,16 +166,21 @@ ${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
$<$<CONFIG:Debug>:-Werror -Wfatal-errors -pedantic-errors>
)
endif()

target_compile_options(${target} INTERFACE
# -fexceptions for linux is not needed, it is on by default
-Wall
-Wextra
# 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
$<$<CONFIG:Debug>:-Werror -Wfatal-errors -pedantic-errors>
-pedantic
-Wcast-qual
-Wcast-align
Expand Down

0 comments on commit 7f4c5d7

Please sign in to comment.