From 890810f5b96d6c7008c65a52faf054349a6ccc3a Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Mon, 10 May 2021 08:11:40 +0200 Subject: [PATCH] add werror flags when making a debug build using llvm (#4338) this would get bugs like https://github.com/Cockatrice/Cockatrice/pull/4337 get signalled earlier to us --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4838bb6..38759aad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,7 +134,11 @@ ELSEIF (CMAKE_COMPILER_IS_GNUCXX) ELSE() # other: osx/llvm, bsd/llvm set(CMAKE_CXX_FLAGS_RELEASE "-O2") - set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") + if(WARNING_AS_ERROR) + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror") + else() + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra") + endif() ENDIF() # GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning