From: Christoph Sommer Date: Sat, 3 Nov 2007 16:25:19 +0000 (+0000) Subject: cmake with DEBUG=ON builds with -WALL -WERROR again X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=bee16854ef08af5cebc5da5c74779bd426ff9209;p=supertux.git cmake with DEBUG=ON builds with -WALL -WERROR again SVN-Revision: 5176 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a80414ba..c77d58be4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,6 @@ MARK_AS_ADVANCED( ## Some default settings -OPTION(DEBUG "Build with debugging options" FALSE) OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" FALSE) OPTION(ENABLE_OPENGL "Enable OpenGL support" TRUE) OPTION(GENERATE_WRAPPER "Build miniswig and generate the wrapper" ${DEBUG}) @@ -211,9 +210,22 @@ ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) # ) #ENDIF(${XGETTEXT} STREQUAL "XGETTEXT-NOTFOUND") + +## Debug options + +OPTION(DEBUG "Build with debugging options" FALSE) +IF (DEBUG) + REMOVE_DEFINITIONS(-O2) + ADD_DEFINITIONS(-O0 -g -pg -Wall -Werror) +ELSE (DEBUG) + ADD_DEFINITIONS(-O2) + REMOVE_DEFINITIONS(-O0 -g -pg -Wall -Werror) +ENDIF (DEBUG) + + ## Some additional compiler switches +ADD_DEFINITIONS(-fno-strict-aliasing) -ADD_DEFINITIONS(-O2 -fno-strict-aliasing) ## Generate supertux executable in the right place