Skip to content

Commit

Permalink
Add check for exported_symbols_list linker option on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
nightlark committed Dec 27, 2024
1 parent 401749a commit f0f7e33
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/helics/shared_api_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,16 @@ if(UNIX OR MINGW)
target_link_libraries(helics PRIVATE -Wl,--exclude-libs,ALL)
endif()
else(NOT_APPLE)
target_link_libraries(
helics PRIVATE -Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/export_mac.txt
include(CheckLinkerFlag)
check_linker_flag(
CXX "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/export_mac.txt"
flag_linker_exported_symbols_list
)
if(flag_linker_exported_symbols_list)
target_link_libraries(
helics PRIVATE -Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/export_mac.txt
)
endif()
endif(NOT APPLE)
endif()

Expand Down

0 comments on commit f0f7e33

Please sign in to comment.