diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt index f57f5c8b64aa9..cf9da0995ca2d 100644 --- a/stdlib/public/core/CMakeLists.txt +++ b/stdlib/public/core/CMakeLists.txt @@ -315,8 +315,16 @@ list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "Freestand list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "Extern") list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "BitwiseCopyable") +if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "") + set(swift_bin_dir "${CMAKE_BINARY_DIR}/bin") + set(swift_lib_dir "${CMAKE_BINARY_DIR}/lib") +else() + set(swift_bin_dir "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}") + set(swift_lib_dir "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib") +endif() + list(APPEND swift_stdlib_compile_flags "-external-plugin-path" - "${CMAKE_BINARY_DIR}/lib/swift/host/plugins#${CMAKE_BINARY_DIR}/bin/swift-plugin-server") + "${swift_lib_dir}/swift/host/plugins#${swift_bin_dir}/swift-plugin-server") list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "SymbolLinkageMarkers") set(swift_core_incorporate_object_libraries)