Build switches -Wall -Werror are only used if cmake switch WERROR is set to ON.
authorChristoph Sommer <mail@christoph-sommer.de>
Sun, 20 Jan 2008 12:52:29 +0000 (12:52 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Sun, 20 Jan 2008 12:52:29 +0000 (12:52 +0000)
Some build environments ship broken header files, so SuperTux won't build with DEBUG ON there.

SVN-Revision: 5287

CMakeLists.txt

index 7ed9a26..e83c442 100644 (file)
@@ -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