Skip to content

Building the Emscripten port

Mátyás Mustoha edited this page Jun 10, 2020 · 11 revisions

The following steps were tested using Emscripten 1.39.17:

unzip data.zip
mkdir build_js && cd build_js

emcmake cmake .. -DNO_NETWORK=1 -DDISABLE_SYSLIB_CHECKS=1 -DUSE_SDL2_LIBS=1
emmake make smw

emcc -o smw.html \
  ./Binaries/Release/smw.bc \
  -s USE_SDL=2 \
  -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png","bmp"]' \
  -s USE_SDL_MIXER=2 \
  -s USE_ZLIB=1 \
  -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=0 -s EXCEPTION_DEBUG=1 \
  -O3 --preload-file ../data@data

You should now have smw.html, ready to play!

Clone this wiki locally