Skip to content

Commit 3f140d7

Browse files
Specified WASI dynamic library extension. (#311)
1 parent a365934 commit 3f140d7

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
@@ -224,7 +224,7 @@ extension Triple {
224224
case .windows:
225225
return ".dll"
226226
case .wasi:
227-
fatalError("WebAssembly/WASI doesn't support dynamic library yet")
227+
return ".wasm"
228228
}
229229
}
230230

Tests/TSCUtilityTests/TripleTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,12 @@ class TripleTests : XCTestCase {
4343
let intelMacOSTriple = try Triple("x86_64-apple-macos")
4444
XCTAssertNotEqual(macOSTriple, intelMacOSTriple)
4545
}
46+
47+
func testWASI() throws {
48+
let wasi = try Triple("wasm32-unknown-wasi")
49+
50+
// WASI dynamic libraries are only experimental,
51+
// but SwiftPM requires this property not to crash.
52+
_ = wasi.dynamicLibraryExtension
53+
}
4654
}

0 commit comments

Comments
 (0)