diff --git a/src/core/cmakehelper.cmake b/src/core/cmakehelper.cmake index f8e0588..57a27e2 100644 --- a/src/core/cmakehelper.cmake +++ b/src/core/cmakehelper.cmake @@ -67,9 +67,15 @@ function(setup_compile_params arg_target) -Wall -Wextra -Werror $<$>:-ffunction-sections -fdata-sections> # -fcf-protection=full? -Wa,-mno-branches-within-32B-boundaries? ) - target_link_options(${arg_target} PRIVATE - $<$>:-Wl,--gc-sections> - ) + if(APPLE) + target_link_options(${arg_target} PRIVATE + $<$>:-Wl,-dead_strip> + ) + else() + target_link_options(${arg_target} PRIVATE + $<$>:-Wl,--gc-sections> + ) + endif() #[[if(CLANG) target_compile_options(${arg_target} PRIVATE $<$>:-Xclang -cfguard -mretpoline>