From: Tim Goya Date: Sat, 3 Nov 2007 21:45:33 +0000 (+0000) Subject: Separate profiling and debugging options, and only use GCC options if the compiler... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b97b8ff26bf4963c96244486782362ccea5d1d96;p=supertux.git Separate profiling and debugging options, and only use GCC options if the compiler actually is GCC SVN-Revision: 5179 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 95549f526..3008a4ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,17 +221,27 @@ ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) ## 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) +OPTION(PROFILE "Build with profiling information" FALSE) +IF(CMAKE_COMPILER_IS_GNUCC) + IF (DEBUG) + REMOVE_DEFINITIONS(-O2) + ADD_DEFINITIONS(-O0 -g -Wall -Werror) + ELSE (DEBUG) + ADD_DEFINITIONS(-O2) + REMOVE_DEFINITIONS(-O0 -g -Wall -Werror) + ENDIF (DEBUG) + IF (PROFILE) + ADD_DEFINITIONS(-pg) + ELSE (PROFILE) + REMOVE_DEFINITIONS(-pg) + ENDIF (PROFILE) +ENDIF(CMAKE_COMPILER_IS_GNUCC) ## Some additional compiler switches -ADD_DEFINITIONS(-fno-strict-aliasing) +IF(CMAKE_COMPILER_IS_GNUCC) + ADD_DEFINITIONS(-fno-strict-aliasing) +ENDIF(CMAKE_COMPILER_IS_GNUCC) ## Generate supertux executable in the right place