From f5fd5477e3b3ec716bd71c9d2ee3414e7c7b9dcc Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Wed, 25 Jan 2017 16:19:35 +0100 Subject: [PATCH] cmake: Use new option in check_and_add_flag to add options correctly Previously, -ggdb wouldn't be added when using the Xcode generator. And now, the code for -fomit-frame-pointer is much more simple. --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 628f877e98..ebe62caf49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,10 +225,8 @@ else() check_and_add_flag(VISIBILITY_INLINES_HIDDEN -fvisibility-inlines-hidden) check_and_add_flag(VISIBILITY_HIDDEN -fvisibility=hidden) - 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() + check_and_add_flag(FOMIT_FRAME_POINTER -fomit-frame-pointer RELEASE_ONLY) + check_and_add_flag(GGDB -ggdb DEBUG_ONLY) if(NOT ANDROID AND _M_X86_64) # PIE is required on Android, but not supported with the x86_64 jit currently @@ -337,7 +335,6 @@ endif() if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-D_DEBUG) - check_and_add_flag(GGDB -ggdb) option(ENABLE_GPROF "Enable gprof profiling (must be using Debug build)" OFF) if(ENABLE_GPROF)