From: Christoph Sommer Date: Sun, 20 Jan 2008 12:52:29 +0000 (+0000) Subject: Build switches -Wall -Werror are only used if cmake switch WERROR is set to ON. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2807b13d3c97eab1b7e257e8554c052a4a94775b;p=supertux.git 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 --- 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