Skip to content

[SourceKit] Add required rpath back to sourcekitd RPATH_LIST #62416

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 1 commit into from
Dec 6, 2022
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
9 changes: 6 additions & 3 deletions tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,9 @@ macro(add_sourcekit_framework name)
set(RPATH_LIST)
add_sourcekit_swift_runtime_link_flags(${name} "${SOURCEKIT_LIBRARY_OUTPUT_INTDIR}" ${SOURCEKITFW_HAS_SWIFT_MODULES})
file(RELATIVE_PATH relative_lib_path
"${framework_location}/Versions/A" "${SOURCEKIT_LIBRARY_OUTPUT_INTDIR}/swift/host")
"${framework_location}/Versions/A" "${SOURCEKIT_LIBRARY_OUTPUT_INTDIR}")
list(APPEND RPATH_LIST "@loader_path/${relative_lib_path}")
list(APPEND RPATH_LIST "@loader_path/${relative_lib_path}/swift/host")

set_target_properties(${name} PROPERTIES
BUILD_WITH_INSTALL_RPATH TRUE
Expand Down Expand Up @@ -466,8 +467,9 @@ macro(add_sourcekit_framework name)
set(RPATH_LIST)
add_sourcekit_swift_runtime_link_flags(${name} "${framework_location}" SOURCEKITFW_HAS_SWIFT_MODULES RPATH_LIST)
file(RELATIVE_PATH relative_lib_path
"${framework_location}" "${SOURCEKIT_LIBRARY_OUTPUT_INTDIR}/swift/host")
"${framework_location}" "${SOURCEKIT_LIBRARY_OUTPUT_INTDIR}")
list(APPEND RPATH_LIST "@loader_path/${relative_lib_path}")
list(APPEND RPATH_LIST "@loader_path/${relative_lib_path}/swift/host")

set_target_properties(${name} PROPERTIES
BUILD_WITH_INSTALL_RPATH TRUE
Expand Down Expand Up @@ -555,8 +557,9 @@ macro(add_sourcekit_xpc_service name framework_target)
set(RPATH_LIST)
add_sourcekit_swift_runtime_link_flags(${name} ${xpc_bin_dir} ${SOURCEKITXPC_HAS_SWIFT_MODULES})

file(RELATIVE_PATH relative_lib_path "${xpc_bin_dir}" "${lib_dir}/swift/host")
file(RELATIVE_PATH relative_lib_path "${xpc_bin_dir}" "${lib_dir}")
list(APPEND RPATH_LIST "@loader_path/${relative_lib_path}")
list(APPEND RPATH_LIST "@loader_path/${relative_lib_path}/swift/host")

# Add rpath for sourcekitdInProc
# lib/${framework_target}.framework/Versions/A/XPCServices/${name}.xpc/Contents/MacOS/${name}
Expand Down