Skip to content

Commit

Permalink
macOS linker does not support --version-script
Browse files Browse the repository at this point in the history
for setting visibility, default hidden symbols with fine tuned  '__attribute__((visibility (default)))' may be used

Signed-off-by: kozyilmaz <[email protected]>
  • Loading branch information
kozyilmaz committed May 11, 2024
1 parent 31e510b commit 77e8e9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 77e8e9c

Please sign in to comment.