From b34a0fc8695b7a1556c9b933400bbe6efb068020 Mon Sep 17 00:00:00 2001 From: degomme Date: Tue, 21 Jun 2016 16:11:41 +0200 Subject: [PATCH] Disable extended warnings when debug is set to false. This mode is for performance only, and removes xbt_assert and XBT_DEBUG, causing a lot of unused warnings. Let them be, as they are not really annoying. --- tools/cmake/GCCFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index 22ef81faee..f71ff39fe0 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -13,7 +13,7 @@ set(warnCFLAGS "") set(optCFLAGS "") set(warnCXXFLAGS "") -if(enable_compile_warnings) +if(enable_compile_warnings AND enable_debug) set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror") if(CMAKE_COMPILER_IS_GNUCC) set(warnCFLAGS "${warnCFLAGS} -Wclobbered -Wno-error=clobbered -Wno-unused-local-typedefs -Wno-error=attributes") -- 2.20.1