Skip to content

Commit b055217

Browse files
committed
Build WasmKit with host SwiftPM when SwiftPM is not built
Currently, passing `--wasmkit` to `build-script` also requires `--swiftpm --install-swiftpm` and all of their dependencies (at the very least Dispatch, Foundation, XCTest, Testing, llbuild, swift-build). We can conditionally switch to host SwiftPM in this case.
1 parent 0f963d7 commit b055217

File tree

1 file changed

+4
-5
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+4
-5
lines changed

utils/swift_build_support/swift_build_support/products/wasmkit.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@ def cli_file_path(cls, build_dir):
7373

7474

7575
def run_swift_build(host_target, product, swiftpm_package_product_name, set_installation_rpath=False):
76-
if product.args.build_runtime_with_host_compiler:
77-
swift_build = product.toolchain.swift_build
78-
else:
79-
# Building with the freshly-built SwiftPM
80-
swift_build = os.path.join(product.install_toolchain_path(host_target), "bin", "swift-build")
76+
swift_build = os.path.join(product.install_toolchain_path(host_target), "bin", "swift-build")
77+
78+
if not os.path.exists(swift_build) or product.args.build_runtime_with_host_compiler:
79+
swift_build = product.toolchain.swift_build
8180

8281
if host_target.startswith('macos'):
8382
# Universal binary on macOS

0 commit comments

Comments
 (0)