Write a proper build for HelloWasm app - #9285
Open
alexreinking wants to merge 3 commits into
Open
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The single-file CMakeLists.txt worked but hand-invoked
emccdirectly, 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
Stack created with GitHub Stacks CLI • Give Feedback 💬