/wasm

Primary LanguageJavaScript

WASM - Collection of small WASM-Emscripten samples

Projects

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

Project structure

Every project has two folders:

Folder Purpose
src Source files
build Powershell build script & CMake config

Build instrsuctions (on Windows)

Prerequisites

How to build and run