From 11115e9aa845d675a88e18e729913f0aaa11e322 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:16:09 +0000 Subject: [PATCH] cmake: Always provide `RPATH` on NetBSD --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dba6f255d4..474eb3504c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,8 +580,13 @@ endif() # Relevant discussions: # - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953 # - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833 -set(CMAKE_SKIP_BUILD_RPATH TRUE) -set(CMAKE_SKIP_INSTALL_RPATH TRUE) +# NetBSD always requires runtime paths to be set for executables. +if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +else() + set(CMAKE_SKIP_BUILD_RPATH TRUE) + set(CMAKE_SKIP_INSTALL_RPATH TRUE) +endif() add_subdirectory(test) add_subdirectory(doc)