Skip to content

Commit 8e4697d

Browse files
authored
Pass sdk option to Swift compiler for WASI triples (#2735)
When building for WebAssembly/WASI `swiftc` needs the `-sdk` option passed to it with the sdk path.
1 parent 984618b commit 8e4697d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Workspace/UserToolchain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public final class UserToolchain: Toolchain {
223223
}
224224

225225
public static func deriveSwiftCFlags(triple: Triple, destination: Destination) -> [String] {
226-
return (triple.isDarwin() || triple.isAndroid()
226+
return (triple.isDarwin() || triple.isAndroid() || triple.isWASI()
227227
? ["-sdk", destination.sdk.pathString]
228228
: [])
229229
+ destination.extraSwiftCFlags

0 commit comments

Comments
 (0)