From b97b8ff26bf4963c96244486782362ccea5d1d96 Mon Sep 17 00:00:00 2001 From: Tim Goya Date: Sat, 3 Nov 2007 21:45:33 +0000 Subject: [PATCH] Separate profiling and debugging options, and only use GCC options if the compiler actually is GCC SVN-Revision: 5179 --- CMakeLists.txt | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) 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 -- 2.11.0