From 2807b13d3c97eab1b7e257e8554c052a4a94775b Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sun, 20 Jan 2008 12:52:29 +0000 Subject: [PATCH] Build switches -Wall -Werror are only used if cmake switch WERROR is set to ON. Some build environments ship broken header files, so SuperTux won't build with DEBUG ON there. SVN-Revision: 5287 --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ed9a2631..e83c4429f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,19 +164,25 @@ 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) IF(CMAKE_COMPILER_IS_GNUCC) IF (DEBUG) REMOVE_DEFINITIONS(-O2) - ADD_DEFINITIONS(-O0 -g -Wall -Werror) + ADD_DEFINITIONS(-O0 -g) ELSE (DEBUG) ADD_DEFINITIONS(-O2) - REMOVE_DEFINITIONS(-O0 -g -Wall -Werror) + REMOVE_DEFINITIONS(-O0 -g) ENDIF (DEBUG) IF (PROFILE) ADD_DEFINITIONS(-pg) 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 -- 2.11.0