Skip to content

swift_build_support: Add WASI to StdlibDeploymentTarget #39244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion utils/swift_build_support/swift_build_support/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ class StdlibDeploymentTarget(object):

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

WASI = Platform("wasi", archs=["wasm32"])

# The list of known platforms.
known_platforms = [
OSX,
Expand All @@ -256,7 +258,8 @@ class StdlibDeploymentTarget(object):
Cygwin,
Android,
Windows,
Haiku]
Haiku,
WASI]

# Cache of targets by name.
_targets_by_name = dict((target.name, target)
Expand Down Expand Up @@ -338,6 +341,10 @@ def host_target():
if machine == 'x86_64':
return StdlibDeploymentTarget.Haiku.x86_64

elif system == 'WASI':
if machine == 'wasm32':
return StdlibDeploymentTarget.WASI.wasm32

raise NotImplementedError('System "%s" with architecture "%s" is not '
'supported' % (system, machine))

Expand Down