From: Tim Goya Date: Wed, 22 Oct 2008 18:34:13 +0000 (+0000) Subject: Use CMake variable to control release vs. debug vs. profile X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=afd5f1b33c110104a7f286d6d7854157919a0a52;p=supertux.git Use CMake variable to control release vs. debug vs. profile SVN-Revision: 5801 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b8b3c41e5..fedd77a6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,26 +194,15 @@ ENDIF(PRECOMPILE_HEADERS) ## Debug options -OPTION(DEBUG "Build with debugging options" OFF) -OPTION(PROFILE "Build with profiling information" 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) - ENDIF (DEBUG) - IF (PROFILE) - ADD_DEFINITIONS(-pg) - ELSE (PROFILE) - REMOVE_DEFINITIONS(-pg) - ENDIF (PROFILE) + ADD_DEFINITIONS(-Wall -Wextra) + SET(CMAKE_CXX_FLAGS_PROFILE "-pg") + SET(CMAKE_C_FLAGS_PROFILE "-pg") + SET(CMAKE_LD_FLAGS_PROFILE "-pg") + IF(WERROR) + ADD_DEFINITIONS(-Werror) + ENDIF(WERROR) ENDIF(CMAKE_COMPILER_IS_GNUCC) ## Add in squirrel debug stuff