Skip to content

Commit b1236e9

Browse files
authored
swift_build_support: Add WASI to StdlibDeploymentTarget (swiftlang#39244)
This change adds support for WASI to `StdlibDeploymentTarget` in `swift_build_support/targets.py`. This will allow us to build stdlib for WASI in the future. Related to SR-9307.
1 parent c119e4d commit b1236e9

File tree

1 file changed

+8
-1
lines changed
  • utils/swift_build_support/swift_build_support

1 file changed

+8
-1
lines changed

utils/swift_build_support/swift_build_support/targets.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ class StdlibDeploymentTarget(object):
243243

244244
Haiku = Platform("haiku", archs=["x86_64"])
245245

246+
WASI = Platform("wasi", archs=["wasm32"])
247+
246248
# The list of known platforms.
247249
known_platforms = [
248250
OSX,
@@ -256,7 +258,8 @@ class StdlibDeploymentTarget(object):
256258
Cygwin,
257259
Android,
258260
Windows,
259-
Haiku]
261+
Haiku,
262+
WASI]
260263

261264
# Cache of targets by name.
262265
_targets_by_name = dict((target.name, target)
@@ -338,6 +341,10 @@ def host_target():
338341
if machine == 'x86_64':
339342
return StdlibDeploymentTarget.Haiku.x86_64
340343

344+
elif system == 'WASI':
345+
if machine == 'wasm32':
346+
return StdlibDeploymentTarget.WASI.wasm32
347+
341348
raise NotImplementedError('System "%s" with architecture "%s" is not '
342349
'supported' % (system, machine))
343350

0 commit comments

Comments
 (0)