Try exported symbols list for Apple

visibility annotations seem to be working for gcc
This commit is contained in:
2024-01-24 15:18:00 -08:00
parent ae528d3f81
commit d76ac2a254
2 changed files with 7 additions and 5 deletions

View File

@@ -61,10 +61,12 @@ add_custom_command(
${CMAKE_OBJCOPY} --keep-global-symbols=${CMAKE_SOURCE_DIR}/symbols.txt
$<TARGET_FILE:${PROJECT_NAME}_static>)
if(NOT APPLE)
if(APPLE)
target_link_options(
${PROJECT_NAME} PRIVATE
"LINKER:-export-symbols=${CMAKE_CURRENT_SOURCE_DIR}/linker.map")
${PROJECT_NAME}
PRIVATE
"LINKER:-no_weak_exports,-exported_symbols_list,${CMAKE_SOURCE_DIR}/symbols.txt"
)
endif()
set(TEST_FLAGS -Wall -Wextra -Wpedantic -Wunreachable-code -UNDEBUG)