From 9a97aaa35f51e03f4f8276fc64c9ec1de9c70204 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Mon, 3 Sep 2012 17:51:20 +0200 Subject: [PATCH] cmake: move Wflags to build type pedantic Signed-off-by: Daniel Borkmann --- src/CMakeLists.txt | 69 +++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 795e175f..1cb14f67 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,40 +31,45 @@ add_definitions( -march=native -mtune=native -Wall - -Wundef - -Wstrict-prototypes - -Werror-implicit-function-declaration - -Wformat=2 - -Wcomments - -Wendif-labels - -Wuninitialized - -Winit-self - -Wstrict-overflow=1 - -Wtype-limits - -Wmissing-parameter-type - -Wclobbered - -Wempty-body - -Wignored-qualifiers - -Wmissing-include-dirs - -Woverlength-strings - -Wmissing-field-initializers - -Wmissing-declarations - -Wmissing-prototypes - -Wlogical-op - -Woverride-init - -Wnested-externs - -Wredundant-decls - -Winvalid-pch - -Wdisabled-optimization - -Wstack-protector - -Waggregate-return - -Wcast-align - -Wunsafe-loop-optimizations - -Wfloat-equal - -Wunknown-pragmas - -Wunused-function ) +if(CMAKE_BUILD_TYPE STREQUAL pedantic) + add_definitions( + -Wundef + -Wstrict-prototypes + -Werror-implicit-function-declaration + -Wformat=2 + -Wcomments + -Wendif-labels + -Wuninitialized + -Winit-self + -Wstrict-overflow=1 + -Wtype-limits + -Wmissing-parameter-type + -Wclobbered + -Wempty-body + -Wignored-qualifiers + -Wmissing-include-dirs + -Woverlength-strings + -Wmissing-field-initializers + -Wmissing-declarations + -Wmissing-prototypes + -Wlogical-op + -Woverride-init + -Wnested-externs + -Wredundant-decls + -Winvalid-pch + -Wdisabled-optimization + -Wstack-protector + -Waggregate-return + -Wcast-align + -Wunsafe-loop-optimizations + -Wfloat-equal + -Wunknown-pragmas + -Wunused-function + ) +endif(CMAKE_BUILD_TYPE STREQUAL pedantic) + if(CMAKE_BUILD_TYPE STREQUAL profile) add_definitions( -g -- 2.11.4.GIT