cmake: Readd fomit-frame-pointer on macOS

Make it also properly set on Release for multi-configuration generators
This commit is contained in:
Florent Castelli 2017-01-25 05:33:36 +01:00
parent 8f355962ce
commit ff4ef08745
1 changed files with 5 additions and 4 deletions

View File

@ -221,6 +221,11 @@ if(NOT MSVC)
check_and_add_flag(INIT_SELF -Winit-self)
check_and_add_flag(MISSING_DECLARATIONS -Wmissing-declarations)
check_and_add_flag(MISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations)
check_c_compiler_flag(-fomit-frame-pointer FLAG_C_FOMIT_FRAME_POINTER)
if(FLAG_C_FOMIT_FRAME_POINTER)
add_compile_options($<$<CONFIG:Release>:-fomit-frame-pointer>)
endif()
endif(NOT MSVC)
# gcc uses some optimizations which might break stuff without this flag
@ -343,10 +348,6 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug)
endif()
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
if(CMAKE_BUILD_TYPE STREQUAL Release AND NOT APPLE)
add_definitions(-fomit-frame-pointer)
endif()
if(FASTLOG)
add_definitions(-DDEBUGFAST)
endif()