Only enable werror for debug (#5501)

This commit is contained in:
KingCol13 2023-09-27 18:56:25 +01:00 committed by GitHub
parent 02cb4ef41e
commit 1d4e036e39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,9 +152,6 @@ function(set_exe_flags TARGET)
target_compile_options(
${TARGET} PRIVATE
# Warnings-as-errors only on Clang for now:
-Werror
# TODO: actually fix the warnings instead of disabling them
# or at least disable on a file-level basis:
-Wno-missing-noreturn -Wno-padded -Wno-implicit-fallthrough
@ -169,6 +166,16 @@ function(set_exe_flags TARGET)
-Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-error=unused-command-line-argument
)
# Werror only for debug builds
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(
${TARGET} PRIVATE
# Warnings-as-errors only on Clang for now:
-Werror
)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
target_compile_options(
${TARGET} PRIVATE