Skip to content

[SourceKit/CMake] Make sure the XPC service executable isn't linked with an absolute build directory rpath #17519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,13 @@ macro(add_sourcekit_xpc_service name framework_target)

add_dependencies(${framework_target} ${name})

# This is necessary to avoid having an rpath with an absolute build directory.
# Without this, such an rpath is added during build time and preserved at install time.
set_target_properties(${name} PROPERTIES
BUILD_WITH_INSTALL_RPATH On
INSTALL_RPATH "@loader_path/../lib"
INSTALL_NAME_DIR "@rpath")

if (SOURCEKIT_DEPLOYMENT_OS MATCHES "^macosx")
add_custom_command(TARGET ${name} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/XPCServices" XPCServices
Expand Down