mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
94b3e80470
Wire the `wasm32-unknown-emscripten` target through the build infrastructure. No Swift stdlib code yet. - Product classes `EmscriptenSysroot` and `EmscriptenLLVMRuntimeLibs` (emsdk sysroot + compiler-rt builtins), `EmscriptenStdlib` (configures the stdlib + SDK overlay against the sysroot), `EmscriptenSwiftSDK` (bundles the artifacts into a redistributable SDK archive). - CLI flags `--build-emscripten-stdlib`, `--skip-test-emscripten-stdlib`, `--emscripten-path`. Default build flows are unaffected unless `--build-emscripten-stdlib` is passed. - `utils/wasm/emscripten-run.py` runner (Node.js), alongside `utils/wasm/wasi-run.py`. - `SwiftUtils.cmake` adds the `SWIFT_WASM_HOSTED_SDKS` registry and `sdk_has_wasm_sysroot()` so `test/CMakeLists.txt` derives the per-SDK embedded test target instead of hardcoding WASI. - `stdlib/public/CMakeLists.txt` and `test/CMakeLists.txt` handle the `EMSCRIPTEN` SDK but stay inert until `SWIFT_EMSCRIPTEN_SYSROOT_PATH` is set, which only happens via `--build-emscripten-stdlib`.