[hannk] Add support for building/running for wasm #6361
Merged
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.
Adds limited support for building and running hannk under WebAssembly. (Note that this requires #6360 to land first.)
Requirements:
Caveats: this uses some seriously janky tricks for cross-compiling (all in apps/hannk/halide/CMakeLists.txt); the basic idea is that when crosscompiling, we re-run CMake on the subdirectory, but with an attempt to revert to the default host tooling (rather than what Emscripten has put in place), then set up dependencies to build and run the Generators that way, and then re-connect the generated libraries in the enclosing CMake file.
This works for me locally, and may be acceptable for an app of this sort. (Whether it is robust enough for "real" apps is not clear.) As usual, @alexreinking, I welcome your cmake-fu to let me know whether this is liable to break immediately and/or could be improved. (If this approach actually seems reasonable, it might be good to find a way to generalize it to allow easier wasm builds of other apps...)
I'm going to go ahead and request a review for this, but it may well need more attention before landing.