Complete and self-contained minimal example of C++ to WASM compilation
MIT License
There are a few precedents (listed below) but didn't find any that ticks all the boxes above.
Just make sure your git is configured with lfs. Needed to download the compiler and linker binaries.
Compiles and links C++ code to WASM
./build.sh
Starts a local Web server so you can run the code. Open in your browser http://localhost:8080
./run.sh
https://releases.llvm.org/download.html
Clang and wasm-ld binaries copied from (Arm64 / Darwin): https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.7
http://schellcode.github.io/wajic-how-and-why
https://github.com/ern0/howto-wasm-minimal/tree/master
https://github.com/robrohan/wefx/blob/main/Makefile
https://github.com/Aransentin/wasmdemo/blob/master/build.sh
https://github.com/schellingb/wajic
Looking at the text representation of WASM is educational and sometimes useful for debugging. With the link below you can easily convert the wasm binary file to human readable text.