Skill: Build WASM
Build the WASM module from C++ sources and verify the output.
Usage
- •
/build-wasm— standard build - •
/build-wasm clean— clean previous artifacts first
Steps
- •
If
cleanargument provided:bashrm -rf build/
- •
Run the WASM build:
bashnpm run build:wasm
- •
Verify output files exist:
bashls -la public/zxspec.js public/zxspec.wasm
- •
Count exported functions in the build:
bashgrep -c 'EMSCRIPTEN_KEEPALIVE' src/bindings/wasm_interface.cpp
- •
Report build status:
- •Success/failure
- •Output file sizes
- •Number of exported functions
- •Any warnings from the build
Troubleshooting
If the build fails:
- •Check that Emscripten SDK is activated (
source emsdk_env.sh) - •Verify ROM files exist in
roms/directory (48.romrequired) - •Check for C++ compilation errors in the output
- •Ensure
build/directory can be created