From: Matthias Braun Date: Sun, 20 Jan 2008 15:56:53 +0000 (+0000) Subject: use -Werror by default in debug mode builds X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=44a91a42e0af4337ea1fde201bcc7849a3204561;p=supertux.git use -Werror by default in debug mode builds SVN-Revision: 5291 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e83c4429f..ca212d47b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,11 +164,15 @@ FILE(GLOB SUPERTUX_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/*.cpp src/audio/* OPTION(DEBUG "Build with debugging options" OFF) OPTION(PROFILE "Build with profiling information" OFF) -OPTION(WERROR "Build stops on first compiler warning" OFF) +OPTION(WERROR "Stops on first compiler warning in debug mode" ON) IF(CMAKE_COMPILER_IS_GNUCC) + ADD_DEFINITIONS(-Wall -W) IF (DEBUG) REMOVE_DEFINITIONS(-O2) ADD_DEFINITIONS(-O0 -g) + IF(WERROR) + ADD_DEFINITIONS(-Werror) + ENDIF(WERROR) ELSE (DEBUG) ADD_DEFINITIONS(-O2) REMOVE_DEFINITIONS(-O0 -g) @@ -178,11 +182,6 @@ IF(CMAKE_COMPILER_IS_GNUCC) ELSE (PROFILE) REMOVE_DEFINITIONS(-pg) ENDIF (PROFILE) - IF (WERROR) - ADD_DEFINITIONS(-Wall -Werror) - ELSE (WERROR) - REMOVE_DEFINITIONS(-Wall -Werror) - ENDIF (WERROR) ENDIF(CMAKE_COMPILER_IS_GNUCC) ## Add in squirrel debug stuff diff --git a/tools/miniswig/CMakeLists.txt b/tools/miniswig/CMakeLists.txt index 93607a07c..7023334da 100644 --- a/tools/miniswig/CMakeLists.txt +++ b/tools/miniswig/CMakeLists.txt @@ -24,7 +24,8 @@ PROJECT(MINISWIG) ## add additional compiler switches ADD_DEFINITIONS(-include ${CMAKE_BINARY_DIR}/config.h) -REMOVE_DEFINITIONS(-Wall) +# the autogenerated bison/flex is not warning free usually +REMOVE_DEFINITIONS(-Wall -W) ## Include paths to make generated files work