Skip to content

Commit a90e1be

Browse files
authored
Merge pull request #1734 from bnbarham/pad-install-name
[CMake] Allow install_name_tool to edit shared library load paths
2 parents c28f994 + 04b469a commit a90e1be

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/modules/AddSwiftHostLibrary.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ function(add_swift_host_library name)
7070
BUILD_WITH_INSTALL_RPATH YES
7171
)
7272

73+
get_target_property(lib_type ${name} TYPE)
74+
if(lib_type STREQUAL SHARED_LIBRARY AND CMAKE_SYSTEM_NAME STREQUAL Darwin)
75+
# Allow install_name_tool to update paths (for rdar://109473564)
76+
set_property(TARGET ${name} APPEND_STRING PROPERTY
77+
LINK_FLAGS " -Xlinker -headerpad_max_install_names")
78+
endif()
79+
7380
# Install this target
7481
install(TARGETS ${name}
7582
EXPORT SwiftSyntaxTargets

0 commit comments

Comments
 (0)