Skip to content

Write a proper build for HelloWasm app - #9285

Open
alexreinking wants to merge 3 commits into
mainfrom
alexreinking/wasm-app-build
Open

Write a proper build for HelloWasm app#9285
alexreinking wants to merge 3 commits into
mainfrom
alexreinking/wasm-app-build

Conversation

@alexreinking

Copy link
Copy Markdown
Member

The single-file CMakeLists.txt worked but hand-invoked emcc directly, manually reassembling include paths/flags instead of using CMake's own Emscripten toolchain integration, and never actually produced a working demo end-to-end (index.html was copied into the build dir, but main.js/sw.js, which that copied index.html references, never were, so opening it from the build dir 404s).

Replace it with a proper CMake super-build: generator/ builds the Halide generator with the host compiler; app/ is configured with Emscripten's own CMake toolchain file and builds core.cpp as an ordinary add_executable, linked against the AOT pipeline libraries via target_link_libraries -- no more hand-rolled emcc command line. index.html/main.js/sw.js get staged into the build dir alongside the compiled output, fixing the demo for real.

Converting to a super-build means it can no longer be included directly from apps/CMakeLists.txt (same as HelloiOS), so it gets a dedicated build+test step in testing-macos.yml instead of riding along with the aggregate apps/ ctest run.

Also moves reaction_diffusion_generator.cpp into generator/ and core.cpp into app/, matching every other multi-piece app in this repo.

Fixes #8731

Breaking changes

None.

Checklist

  • Tests added or updated (not required for docs, CI config, or typo fixes)
  • Documentation updated (if public API changed)
  • Python bindings updated (if public API changed)
  • Commits include AI attribution where applicable (see Code of Conduct)

Stack created with GitHub Stacks CLIGive Feedback 💬

alexreinking and others added 3 commits August 6, 2026 09:04
The referenced README_cmake.md doesn't exist; the cross-compiling section
it pointed to lives in doc/HalideCMakePackage.md.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Generators write their outputs there directly, so previously any
OUTPUT_DIR other than an existing target directory (e.g. one already
implied by another CMake target) failed with "No such file or
directory". Drops the equivalent workaround from HelloWasm, which hit
this since each of its wasm variants needs its own OUTPUT_DIR to avoid
filename collisions.
The single-file CMakeLists.txt worked but hand-invoked emcc directly,
manually reassembling include paths/flags instead of using CMake's own
Emscripten toolchain integration, and never actually produced a working
demo end-to-end (index.html was copied into the build dir, but main.js/
sw.js, which that copied index.html references, never were, so opening
it from the build dir 404s).

Replace it with a proper CMake super-build: generator/ builds the Halide
generator with the host compiler; app/ is configured with Emscripten's own
CMake toolchain file and builds core.cpp as an ordinary add_executable,
linked against the AOT pipeline libraries via target_link_libraries --
no more hand-rolled emcc command line. index.html/main.js/sw.js get staged
into the build dir alongside the compiled output, fixing the demo for real.

Converting to a super-build means it can no longer be included directly from
apps/CMakeLists.txt (same as HelloiOS), so it gets a dedicated build+test
step in testing-macos.yml instead of riding along with the aggregate apps/
ctest run.

Also moves reaction_diffusion_generator.cpp into generator/ and core.cpp
into app/, matching every other multi-piece app in this repo.

Fixes #8731

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.27%. Comparing base (f932856) to head (ecbf1b4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9285      +/-   ##
==========================================
- Coverage   70.32%   70.27%   -0.06%     
==========================================
  Files         258      258              
  Lines       79160    79160              
  Branches    18997    18997              
==========================================
- Hits        55672    55631      -41     
- Misses      17802    17806       +4     
- Partials     5686     5723      +37     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Add testing for HelloWasm

1 participant