Tutorial for using Emscripten.
You have to install the following software:
- CMake (3.16 minimum version is needed).
You can find detailed instruction on Emscripten Download and install page. You have to use the following commands to set up the environment for this tutorial:
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
emsdk install latest
emsdk activate latest
emsdk install mingw-4.6.2-32bit
emsdk activate mingw-4.6.2-32bit
You can create the project with CMake, and build it with Visual Studio. This step is optional. The Visual Studio project is useful if you would like to debug the functionalities, but it is not necessary for building the web application.
mkdir Build
cd Build
cmake -G "Visual Studio 16 2019" -A "Win32" ..
cd ..
The easiest way is to run the EmscriptenBuild.bat
file from the root directory. It needs two command line parameters:
- The Emscripten SDK folder (e.g. "C:\Emscripten\emsdk").
- The build configuration type (Debug or Release).
EmscriptenBuild.bat C:\Emscripten\emsdk Debug
- Start a web server in the root directory.
- With Python 3:
python -m http.server 8000
. - On Windows just run the
StartServerWin.bat
script.
- With Python 3:
- Open your browser, and navigate to:
http://localhost:8000/BuildEm
.
You can find the presentation in the "Presentation" folder. The demo links are referring to the url above.