Skip to content

Commit

Permalink
LLDB CMake: add option to link Swift content from Darwin toolchain (s…
Browse files Browse the repository at this point in the history
…wiftlang#8647)

This is a companion to swiftlang/swift#73255, and
it's needed in some Apple internal configurations.

Addresses rdar://127113448
  • Loading branch information
edymtt authored Apr 29, 2024
1 parent 581fa32 commit ead278f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lldb/cmake/modules/AddLLDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ function(add_properties_for_swift_modules target reldir)
APPEND PROPERTY BUILD_RPATH "@loader_path/${build_reldir}lib/swift/host")
set_property(TARGET ${target}
APPEND PROPERTY INSTALL_RPATH "@loader_path/${reldir}lib/swift/host")
if(SWIFT_ALLOW_LINKING_SWIFT_CONTENT_IN_DARWIN_TOOLCHAIN)
get_filename_component(TOOLCHAIN_BIN_DIR ${CMAKE_Swift_COMPILER} DIRECTORY)
get_filename_component(TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR}/../lib/swift/macosx" ABSOLUTE)
target_link_directories(${target} BEFORE PUBLIC ${TOOLCHAIN_LIB_DIR})
endif()
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OpenBSD|FreeBSD")
set_property(TARGET ${target}
APPEND PROPERTY BUILD_RPATH "$ORIGIN/${build_reldir}lib/swift/host")
Expand Down

0 comments on commit ead278f

Please sign in to comment.