Skip to content

Add support for Emscripten platform separate from WASI#1335

Merged
MaxDesiatov merged 2 commits into
swiftlang:mainfrom
MaxDesiatov:maxd/emscripten
Apr 29, 2026
Merged

Add support for Emscripten platform separate from WASI#1335
MaxDesiatov merged 2 commits into
swiftlang:mainfrom
MaxDesiatov:maxd/emscripten

Conversation

@MaxDesiatov
Copy link
Copy Markdown
Contributor

One of the necessary steps for implementing the Emscripten pitch: https://forums.swift.org/t/pitch-emscripten-target-support-for-swift/85310

@MaxDesiatov
Copy link
Copy Markdown
Contributor Author

@swift-ci test

Comment thread Sources/SWBWebAssemblyPlatform/Plugin.swift Outdated
Comment thread Sources/SWBWebAssemblyPlatform/Plugin.swift Outdated
Comment thread Sources/SWBWebAssemblyPlatform/Plugin.swift Outdated
Comment thread Sources/SWBWebAssemblyPlatform/Plugin.swift Outdated
Copy link
Copy Markdown
Collaborator

@jakepetroules jakepetroules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few spelling issues in the platform definition (those properties are all expected to differ only by case).

@MaxDesiatov
Copy link
Copy Markdown
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov merged commit 30bbc84 into swiftlang:main Apr 29, 2026
122 of 126 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/emscripten branch April 29, 2026 08:14
case android
case windows
case wasi
case emscripten
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just broke building SwiftPM on CI:

14:09:47  /Users/ec2-user/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx-release-toolchain/branch-main/swiftpm/Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:569:17: error: switch must be exhaustive
14:09:47  567 |             for platform in ProjectModel.BuildSettings.Platform.allCases {
14:09:47  568 |                 // darwin & freebsd
14:09:47  569 |                 switch platform {
14:09:47      |                 |- error: switch must be exhaustive
14:09:47      |                 `- note: add missing case: '.emscripten'
14:09:47  570 |                     case .macOS, .macCatalyst, .iOS, .watchOS, .tvOS, .xrOS, .driverKit, .freebsd:
14:09:47  571 |                         impartedSettings[.OTHER_LDFLAGS, platform] = ["-lc++", "$(inherited)"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swiftlang/swift-package-manager#10002 has been published to resolve the issue.

cmcgee1024 pushed a commit that referenced this pull request Apr 29, 2026
@MaxDesiatov MaxDesiatov restored the maxd/emscripten branch May 11, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants