Skip to content

Commit a9b4298

Browse files
committed
[🍒/20240408] LLDB CMake: add option to link Swift content from Darwin toolchain
This is a companion to swiftlang/swift#73255, and it's needed in some Apple internal configurations. Addresses rdar://127113448 (cherry picked from commit ead278f)
1 parent 8e5a826 commit a9b4298

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎lldb/cmake/modules/AddLLDB.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ function(add_properties_for_swift_modules target reldir)
244244
APPEND PROPERTY BUILD_RPATH "@loader_path/${build_reldir}lib/swift/host")
245245
set_property(TARGET ${target}
246246
APPEND PROPERTY INSTALL_RPATH "@loader_path/${reldir}lib/swift/host")
247+
if(SWIFT_ALLOW_LINKING_SWIFT_CONTENT_IN_DARWIN_TOOLCHAIN)
248+
get_filename_component(TOOLCHAIN_BIN_DIR ${CMAKE_Swift_COMPILER} DIRECTORY)
249+
get_filename_component(TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR}/../lib/swift/macosx" ABSOLUTE)
250+
target_link_directories(${target} BEFORE PUBLIC ${TOOLCHAIN_LIB_DIR})
251+
endif()
247252
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OpenBSD|FreeBSD")
248253
set_property(TARGET ${target}
249254
APPEND PROPERTY BUILD_RPATH "$ORIGIN/${build_reldir}lib/swift/host")

0 commit comments

Comments
 (0)