Each of the following is a standalone project:
Project | Description |
---|---|
hello-world | Invoking function main() + index.html generated by em++ |
ccall-add | Using ccall/cwrap to invoke a simple C function |
ccall-array | Using ccall/cwrap to invoke a C function returning an array, and using Module.HEAPU8 to access it |
direct-add | Calling a simple C function directly without ccall/cwrap |
embind-add | Calling a simple C++ function using embind |
embind-greet | Calling a C++ function that gets and returns a string using embind |
malloc | Measuring the actual consumption of dynamic allocations |
two-modules | Instantiating two WASM modules from one app |
two-modules-shared-mem | Instantiating two WASM modules with shared memory |
source-maps | Enabling source-maps for debugging in the browser |
Every project has two folders:
Folder | Purpose |
---|---|
src | Source files |
build | Powershell build script & CMake config |
- Run Docker For Windows (required for invoking Emscripten)
- Go to
build
folder and runbuild_and_run.ps1
using PowerShell - Navigate to http://localhost:6931