From e456cb34b29ada6e9d34a9832c9631c1108e8c2e Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Sat, 6 May 2023 09:54:00 -0700 Subject: [PATCH] turn off compile warnings as error unless Debug build Related to #915. I do not want bug reports about compile errors for code that we have little control over. Now, at least the user can --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6546272f..df6ce6257 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,7 +144,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") endif() endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE STREQUAL "Debug") # Treat warnings as errors with some exceptions set(GCC_FLAGS "-Wall -Werror -Wno-deprecated-declarations") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_FLAGS} -Wno-class-memaccess -Wno-array-compare -Wno-unused-result -Wno-maybe-uninitialized")