From f509c31fe563d714e74f3b2aede8ee4ce622ac71 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Thu, 7 May 2020 11:47:19 +0100 Subject: [PATCH] Pass sdk option to Swift compiler for WASI triples When building for WebAssembly/WASI `swiftc` needs the `-sdk` option passed to it with the sdk path. --- Sources/Workspace/UserToolchain.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Workspace/UserToolchain.swift b/Sources/Workspace/UserToolchain.swift index 56cc0733da5..92359d41333 100644 --- a/Sources/Workspace/UserToolchain.swift +++ b/Sources/Workspace/UserToolchain.swift @@ -223,7 +223,7 @@ public final class UserToolchain: Toolchain { } public static func deriveSwiftCFlags(triple: Triple, destination: Destination) -> [String] { - return (triple.isDarwin() || triple.isAndroid() + return (triple.isDarwin() || triple.isAndroid() || triple.isWASI() ? ["-sdk", destination.sdk.pathString] : []) + destination.extraSwiftCFlags