Skip to content

Building Games for WebAssembly

Matthew LaRocca edited this page Jun 23, 2026 · 2 revisions

Building for WebAssembly

The easiest way to configure the project to be built for WebAssembly is to use the official emsdk Docker Container. Otherwise you will need to install and configure Emscripten. The commands in the examples below will utilize docker, however, if you install the SDK locally the steps are largely the same, except you would not invoke docker and instead run the commands in your terminal directory.

This instructions assume that your current working directory is at the project root.

Configuring the project

docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emcmake cmake -DFW64_PLATFORM_WEB:STRING=ON -B /src/build_web

Build Assets

Build the assets for one of the targets:

npm run prepare_example_assets shading_modes web 

Build a target

docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emmake cmake --build build_web --target shading_modes

Clone this wiki locally