Skip to content

Commit afc0938

Browse files
Specified WASI dynamic library extension. (#311) (#349)
Co-authored-by: Jeremy David Giesbrecht <[email protected]>
1 parent 184eba3 commit afc0938

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Sources/TSCUtility/Triple.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ extension Triple {
249249
case .windows:
250250
return ".dll"
251251
case .wasi:
252-
fatalError("WebAssembly/WASI doesn't support dynamic library yet")
252+
return ".wasm"
253253
}
254254
}
255255

Tests/TSCUtilityTests/TripleTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,12 @@ class TripleTests : XCTestCase {
5454
let linuxWithGNUABI = try Triple("x86_64-unknown-linux-gnu")
5555
XCTAssertNotEqual(linuxWithoutGNUABI, linuxWithGNUABI)
5656
}
57+
58+
func testWASI() throws {
59+
let wasi = try Triple("wasm32-unknown-wasi")
60+
61+
// WASI dynamic libraries are only experimental,
62+
// but SwiftPM requires this property not to crash.
63+
_ = wasi.dynamicLibraryExtension
64+
}
5765
}

0 commit comments

Comments
 (0)