From 84c6a2bfc2f0a7086defeffb190e2935d5faa453 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Thu, 8 Aug 2024 11:51:13 -0700 Subject: [PATCH] Disable debug symbols and frame pointer for macos This causes some versions of clang to crash --- CMakeLists.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1a9b57..facdc63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,14 +31,12 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "MinSizeRel" "RelWithDebInfo") endif() -add_compile_options( - -fdata-sections - -ffunction-sections - -Wswitch-enum - -Werror=switch-enum - -fPIC - -g - -fno-omit-frame-pointer) +add_compile_options(-fdata-sections -ffunction-sections -Wswitch-enum + -Werror=switch-enum -fPIC) +if(NOT APPLE) + # This causes some versions of clang to crash on macos + add_compile_options(-g -fno-omit-frame-pointer) +endif() set(full_relro_flags "-pie;LINKER:-z,relro,-z,now,-z,noexecstack") cmake_push_check_state()