Skip to content

Commit 6b586b6

Browse files
authored
Merge pull request #61252 from DougGregor/cmake-link-swiftsyntax-consistently
2 parents 7ab18ff + c50b142 commit 6b586b6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,21 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
568568
endif()
569569
endif()
570570
571+
if(SWIFT_SWIFT_PARSER)
572+
# Make sure we can find the early SwiftSyntax libraries.
573+
target_link_directories(${target} PRIVATE "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/lib")
574+
575+
# For the "end step" of bootstrapping configurations on Darwin, need to be
576+
# able to fall back to the SDK directory for libswiftCore et al.
577+
if (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
578+
if (bootstrapping STREQUAL "")
579+
if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
580+
target_link_directories(${target} PRIVATE "${sdk_dir}")
581+
endif()
582+
endif()
583+
endif()
584+
endif()
585+
571586
set_property(TARGET ${target} PROPERTY BUILD_WITH_INSTALL_RPATH YES)
572587
set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${swift_runtime_rpath}")
573588
endfunction()

0 commit comments

Comments
 (0)