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