Skip to content

Commit 557628c

Browse files
authored
[Debugging] Use SWIFT_NATIVE_SWIFT_TOOLS_PATH if defined (#71814)
Fixes cross-host builds. See https://github.com/apple/swift/pull/71425/files#r1498582734
1 parent f24bb03 commit 557628c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,16 @@ list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "Freestand
315315
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "Extern")
316316
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "BitwiseCopyable")
317317

318+
if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "")
319+
set(swift_bin_dir "${CMAKE_BINARY_DIR}/bin")
320+
set(swift_lib_dir "${CMAKE_BINARY_DIR}/lib")
321+
else()
322+
set(swift_bin_dir "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}")
323+
set(swift_lib_dir "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib")
324+
endif()
325+
318326
list(APPEND swift_stdlib_compile_flags "-external-plugin-path"
319-
"${CMAKE_BINARY_DIR}/lib/swift/host/plugins#${CMAKE_BINARY_DIR}/bin/swift-plugin-server")
327+
"${swift_lib_dir}/swift/host/plugins#${swift_bin_dir}/swift-plugin-server")
320328
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "SymbolLinkageMarkers")
321329

322330
set(swift_core_incorporate_object_libraries)

0 commit comments

Comments
 (0)