mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-28 15:22:27 +00:00
Overwrite CMake default C[XX]FLAGS
CMake sets default flags for the standard build types. We want to replace them, not merge them. Reported by azalyn.
This commit is contained in:
parent
e3f2666f32
commit
a7b3b9fb0b
1 changed files with 10 additions and 27 deletions
|
@ -116,33 +116,16 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
add_definitions(-march=pentium3)
|
add_definitions(-march=pentium3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG -O1")
|
||||||
add_definitions(-g)
|
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
|
||||||
add_definitions(-D_DEBUG)
|
set(CMAKE_C_FLAGS_DEBUGALL "-g -ggdb -D_DEBUG")
|
||||||
add_definitions(-O1)
|
set(CMAKE_CXX_FLAGS_DEBUGALL ${CMAKE_C_FLAGS_DEBUGALL})
|
||||||
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugAll")
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer")
|
||||||
add_definitions(-g)
|
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
|
||||||
add_definitions(-ggdb)
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3 -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer")
|
||||||
add_definitions(-D_DEBUG)
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
|
||||||
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
|
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer")
|
||||||
add_definitions(-O3)
|
set(CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
|
||||||
add_definitions(-ffast-math)
|
|
||||||
add_definitions(-fno-unsafe-math-optimizations)
|
|
||||||
add_definitions(-fomit-frame-pointer)
|
|
||||||
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
||||||
add_definitions(-g)
|
|
||||||
add_definitions(-O3)
|
|
||||||
add_definitions(-ffast-math)
|
|
||||||
add_definitions(-fno-unsafe-math-optimizations)
|
|
||||||
add_definitions(-fomit-frame-pointer)
|
|
||||||
elseif (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
|
||||||
add_definitions(-Os)
|
|
||||||
add_definitions(-ffast-math)
|
|
||||||
add_definitions(-fno-unsafe-math-optimizations)
|
|
||||||
add_definitions(-fomit-frame-pointer)
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Unknown build type")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_definitions(-fno-strict-aliasing)
|
add_definitions(-fno-strict-aliasing)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue