view Applications/Samples/WebAssembly/NOTES.txt @ 2142:ff1aefb43763

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 16 Aug 2024 14:58:47 +0200
parents 65eccce95882
children
line wrap: on
line source


Building WebAssembly samples using Docker
=========================================

The script "./docker-build.sh" can be used to quickly build the
WebAssembly samples on any GNU/Linux distribution equipped with
Docker. This avoids newcomers to install Emscripten and learn the
CMake options. Just type:

$ ./docker-build.sh Release

After successful build, the binaries will be installed in the
following folder (i.e. in the folder "wasm-binaries" at the root of
the source distribution):

$ ls -l ../../wasm-binaries


NB: The source code of the Docker build environment can be found at
the following location:
https://github.com/jodogne/OrthancDocker/tree/master/wasm-builder


Native compilation (without Docker)
===================================

Install Emscripten:
https://emscripten.org/docs/getting_started/downloads.html

Then, if the installation path is "~/Downloads/emsdk/":

# source ~/Downloads/emsdk/emsdk_env.sh
# cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DALLOW_DOWNLOADS=ON -G Ninja
# ninja install

=> The binaries will be put in "../../../wasm-binaries/"