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
This commit is contained in:
ebbit1q 2021-05-10 08:11:40 +02:00 committed by GitHub
parent 8fb561b4c4
commit 890810f5b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,7 +134,11 @@ ELSEIF (CMAKE_COMPILER_IS_GNUCXX)
ELSE() ELSE()
# other: osx/llvm, bsd/llvm # other: osx/llvm, bsd/llvm
set(CMAKE_CXX_FLAGS_RELEASE "-O2") 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() ENDIF()
# GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning # GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning