From 08755ad3f5ecc623ae765c2b23d0bd9538fc4175 Mon Sep 17 00:00:00 2001 From: "Maxim [maxirmx] Samsonov" Date: Sat, 15 Jun 2024 12:07:38 +0300 Subject: [PATCH] Setting RPATH for sexpp-cli (ref https://github.com/rnpgp/rnp/issues/2153) --- .github/workflows/build-and-test.yml | 1 + CMakeLists.txt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index cb4dfaa..6ea333d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -55,6 +55,7 @@ jobs: # Build of sexp dll with MSVC is not supported exclude: - { os: windows-2019, env: { }, shared: on } + - { os: windows-2022, env: { }, shared: on } env: ${{ matrix.env }} steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ac363c..f88042e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,6 +156,12 @@ if (WITH_SEXP_CLI) RUNTIME_OUTPUT_NAME sexpp RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) + if (APPLE AND BUILD_SHARED_LIBS) + # Since cmd line tools version 2397 dyld doesn't look in ../lib + # See https://github.com/rnpgp/rnp/issues/2153 and + # https://developer.apple.com/forums/thread/737920 for the details. + set_target_properties(sexpp-cli PROPERTIES INSTALL_RPATH "@executable_path/../lib") + endif(APPLE AND BUILD_SHARED_LIBS) endif (WITH_SEXP_CLI)