Skip to content

Commit

Permalink
Ad LC_RPATH record while building for macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 authored and antonsviridenko committed Jun 12, 2024
1 parent a8f2318 commit a7ee088
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ci/tests/ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ test_supported_features() {
library_path="${BOTAN_INSTALL}/$so_folder:${JSONC_INSTALL}/$so_folder:${RNP_INSTALL}/$so_folder"
fi

if [[ "$OSTYPE" == darwin* ]]; then
export DYLD_LIBRARY_PATH="$library_path${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}"
else
# For darwin we assume that LC_RPATH is added with @executable_dir/../lib
if [[ ! "$OSTYPE" == darwin* ]]; then
export LD_LIBRARY_PATH="$library_path${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
fi

Expand Down
8 changes: 8 additions & 0 deletions src/rnp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ add_executable(rnp

if(BUILD_SHARED_LIBS)
target_sources(rnp PRIVATE ../lib/logging.cpp $<TARGET_OBJECTS:rnp-common>)

if(APPLE)
# Since cmd line tools version 2397 dyld doesn't look in ../lib
# See issue #2153 and https://developer.apple.com/forums/thread/737920 for the details.
set_target_properties(rnp PROPERTIES
INSTALL_RPATH "@executable_path/../lib"
)
endif(APPLE)
endif(BUILD_SHARED_LIBS)

target_include_directories(rnp
Expand Down
8 changes: 8 additions & 0 deletions src/rnpkeys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ add_executable(rnpkeys

if(BUILD_SHARED_LIBS)
target_sources(rnpkeys PRIVATE ../lib/logging.cpp $<TARGET_OBJECTS:rnp-common>)

if(APPLE)
# Since cmd line tools version 2397 dyld doesn't look in ../lib
# See issue #2153 and https://developer.apple.com/forums/thread/737920 for the details.
set_target_properties(rnpkeys PROPERTIES
INSTALL_RPATH "@executable_path/../lib"
)
endif(APPLE)
endif(BUILD_SHARED_LIBS)

target_include_directories(rnpkeys
Expand Down

0 comments on commit a7ee088

Please sign in to comment.