From 77e8e9c5971ac06f4f2e0e2ae7b1fd6f9ea2d27e Mon Sep 17 00:00:00 2001 From: kozyilmaz Date: Sat, 11 May 2024 19:55:15 +0300 Subject: [PATCH] macOS linker does not support --version-script for setting visibility, default hidden symbols with fine tuned '__attribute__((visibility (default)))' may be used Signed-off-by: kozyilmaz --- src/common/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 7e18909..4f59c50 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -47,11 +47,13 @@ if(NOT EMSCRIPTEN) target_compile_options(cosigner PRIVATE -fstack-protector-strong) endif() +if(NOT APPLE) set(LINKER_VERSION_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/lib.lds) target_link_options(cosigner PRIVATE "LINKER:--version-script=${LINKER_VERSION_SCRIPT}" "LINKER:--no-undefined") set_target_properties(cosigner PROPERTIES LINK_DEPENDS ${LINKER_VERSION_SCRIPT}) +endif() target_include_directories(cosigner PUBLIC ${PROJECT_SOURCE_DIR}/include) target_link_libraries(cosigner PUBLIC OpenSSL::Crypto)