fix macos build

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-10-13 11:55:06 +08:00
parent 4538e80038
commit 8097a30a68
1 changed files with 9 additions and 3 deletions

View File

@ -67,9 +67,15 @@ function(setup_compile_params arg_target)
-Wall -Wextra -Werror -Wall -Wextra -Werror
$<$<NOT:$<CONFIG:Debug>>:-ffunction-sections -fdata-sections> # -fcf-protection=full? -Wa,-mno-branches-within-32B-boundaries? $<$<NOT:$<CONFIG:Debug>>:-ffunction-sections -fdata-sections> # -fcf-protection=full? -Wa,-mno-branches-within-32B-boundaries?
) )
target_link_options(${arg_target} PRIVATE if(APPLE)
$<$<NOT:$<CONFIG:Debug>>:-Wl,--gc-sections> target_link_options(${arg_target} PRIVATE
) $<$<NOT:$<CONFIG:Debug>>:-Wl,-dead_strip>
)
else()
target_link_options(${arg_target} PRIVATE
$<$<NOT:$<CONFIG:Debug>>:-Wl,--gc-sections>
)
endif()
#[[if(CLANG) #[[if(CLANG)
target_compile_options(${arg_target} PRIVATE target_compile_options(${arg_target} PRIVATE
$<$<NOT:$<CONFIG:Debug>>:-Xclang -cfguard -mretpoline> $<$<NOT:$<CONFIG:Debug>>:-Xclang -cfguard -mretpoline>