Skip to content

Commit 0d6b928

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 0d6b928

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/Foundation/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ set_target_properties(Foundation PROPERTIES
168168
INSTALL_RPATH "$ORIGIN"
169169
INSTALL_REMOVE_ENVIRONMENT_RPATH ON)
170170

171+
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
172+
target_link_options(Foundation PRIVATE "LINKER:-z,origin")
173+
endif()
174+
171175
if(dispatch_FOUND)
172176
set_target_properties(Foundation PROPERTIES
173177
BUILD_RPATH "$<TARGET_FILE_DIR:swiftDispatch>")

0 commit comments

Comments
 (0)