From ff4ef0874509f125250894c2c0fdf8122684293b Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Wed, 25 Jan 2017 05:33:36 +0100 Subject: [PATCH] cmake: Readd fomit-frame-pointer on macOS Make it also properly set on Release for multi-configuration generators --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59c4474894..c6769ad889 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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($<$:-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()