Skip to content

Commit 97a150b

Browse files
committed
Add -z,origin linker flag on OpenBSD.
This is required for $ORIGIN rpath processing here (without having to fiddle with workarounds like LD_LIBRARY_PATH).
1 parent af2ecd8 commit 97a150b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ else()
212212
"/clang:-fcf-runtime-abi=swift")
213213
endif()
214214

215+
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD|DragonFlyBSD")
216+
if(CMAKE_INSTALL_RPATH MATCHES "\\$ORIGIN")
217+
add_link_options("LINKER:-z,origin")
218+
endif()
219+
endif()
220+
215221
if(CMAKE_BUILD_TYPE STREQUAL Debug)
216222
list(APPEND _Foundation_common_build_flags
217223
"-DDEBUG")

0 commit comments

Comments
 (0)