diff --git a/CMakeLists.txt b/CMakeLists.txt index 83c9274428..c78b15bfb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,15 +70,11 @@ endif() # Global compile options for all configurations. add_compile_options(-ffast-math) -if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - add_definitions(-DDEBUG) -elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + add_definitions(-DDEBUG -fno-omit-frame-pointer) +elseif (${CMAKE_BUILD_TYPE} MATCHES "^Rel") add_definitions(-DRELEASE) -elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") - add_definitions(-DRELEASE) - add_compile_options( - "-fno-omit-frame-pointer" - ) + add_compile_options(-Ofast) else() message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE}) endif() @@ -103,8 +99,7 @@ option(SKIP_DESKTOP "Skip building of desktop application" OFF) option(BUILD_MAPSHOT "Build mapshot tool" OFF) option(USE_PCH "Use precompiled headers" OFF) -if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) message(FATAL_ERROR "Minimum supported g++ version is 7.0 yours is ${CMAKE_CXX_COMPILER_VERSION}") endif()