Skip to content

Commit 4215ab9

Browse files
authored
Merge pull request #2114 from apple/5.9-swift-swift-linux
[5.9][CMake] Add padding to RUNPATH in linux
2 parents 2ae7e2e + 6958b66 commit 4215ab9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cmake/modules/AddSwiftHostLibrary.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,16 @@ function(add_swift_host_library name)
6666
)
6767

6868
get_target_property(lib_type ${name} TYPE)
69-
if(lib_type STREQUAL SHARED_LIBRARY AND CMAKE_SYSTEM_NAME STREQUAL Darwin)
70-
# Allow install_name_tool to update paths (for rdar://109473564)
71-
set_property(TARGET ${name} APPEND_STRING PROPERTY
72-
LINK_FLAGS " -Xlinker -headerpad_max_install_names")
69+
if(lib_type STREQUAL SHARED_LIBRARY)
70+
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
71+
# Allow install_name_tool to update paths (for rdar://109473564)
72+
set_property(TARGET ${name} APPEND_STRING PROPERTY
73+
LINK_FLAGS " -Xlinker -headerpad_max_install_names")
74+
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
75+
# Make some room to update paths.
76+
set_property(TARGET ${name} APPEND PROPERTY
77+
INSTALL_RPATH ":::::::::::::::::::::::::::::::::::::::::::::::::::::::")
78+
endif()
7379
endif()
7480

7581
# Install this target

0 commit comments

Comments
 (0)