)
## Make certain it is built
SET(SUPERTUX_SOURCES_CXX ${CMAKE_CURRENT_BINARY_DIR}/precompile.hh.gch ${SUPERTUX_SOURCES_CXX})
- SET(CMAKE_CXX_FLAGS "-include ${CMAKE_CURRENT_BINARY_DIR}/precompile.hh" ${CMAKE_CXX_FLAGS})
+ SET(CMAKE_CXX_FLAGS "-include ${CMAKE_CURRENT_BINARY_DIR}/precompile.hh ${CMAKE_CXX_FLAGS}")
ELSE(PRECOMPILE_HEADERS)
IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/precompile.hh)
FILE(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/precompile.hh)
OPTION(WERROR "Stop on first compiler warning" OFF)
OPTION(WARNINGS "Enable long list of warnings for compiler to check" ON)
IF(CMAKE_COMPILER_IS_GNUCC)
- ADD_DEFINITIONS(-Wall -Wextra -funit-at-a-time)
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_CXX_FLAGS_PROFILE "-pg")
SET(CMAKE_C_FLAGS_PROFILE "-pg")
SET(CMAKE_LD_FLAGS_PROFILE "-pg")
+ ADD_DEFINITIONS(-Wall -Wextra -funit-at-a-time)
IF(WERROR)
ADD_DEFINITIONS(-Werror)
ELSE(WERROR)
REMOVE_DEFINITIONS(-Werror)
ENDIF(WERROR)
IF(WARNINGS)
- SET(CMAKE_C_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector")
- SET(CMAKE_CXX_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Weffc++ -Wabi -Wctor-dtor-privacy -Wstrict-null-sentinel -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector")
+ ADD_DEFINITIONS(-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector)
+ SET(CMAKE_CXX_FLAGS "-Weffc++ -Wabi -Wctor-dtor-privacy -Wstrict-null-sentinel ${CMAKE_CXX_FLAGS}")
# -ansi fails in MinGW
# still left: -Wold-style-cast -Wpadded -Wconversion -Wundef -Wsign-conversion -Wshadow -Winline -Wunsafe-loop-optimizations -Wfloat-equal -Wswitch-default -Wswitch-enum -Wcast-qual -Wsign-promo -Woverloaded-virtual -Wmissing-format-attribute -Wstrict-overflow=5 -Wformat=2
ENDIF(WARNINGS)