summaryrefslogtreecommitdiffstats
path: root/SetFlags.cmake
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2023-09-27 19:56:25 +0200
committerGitHub <noreply@github.com>2023-09-27 19:56:25 +0200
commit1d4e036e3973fc446fd38ba200c03f996a9bc903 (patch)
treef16daaf02e792ff2d42ef36373eb20056a33f7ed /SetFlags.cmake
parentChanged large apple tree probability (#5523) (diff)
downloadcuberite-1d4e036e3973fc446fd38ba200c03f996a9bc903.tar
cuberite-1d4e036e3973fc446fd38ba200c03f996a9bc903.tar.gz
cuberite-1d4e036e3973fc446fd38ba200c03f996a9bc903.tar.bz2
cuberite-1d4e036e3973fc446fd38ba200c03f996a9bc903.tar.lz
cuberite-1d4e036e3973fc446fd38ba200c03f996a9bc903.tar.xz
cuberite-1d4e036e3973fc446fd38ba200c03f996a9bc903.tar.zst
cuberite-1d4e036e3973fc446fd38ba200c03f996a9bc903.zip
Diffstat (limited to 'SetFlags.cmake')
-rw-r--r--SetFlags.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/SetFlags.cmake b/SetFlags.cmake
index 98878de4a..1c1071499 100644
--- a/SetFlags.cmake
+++ b/SetFlags.cmake
@@ -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