-
Notifications
You must be signed in to change notification settings - Fork 136
compiling_Emscripten
Bruno Levy edited this page Dec 19, 2022
·
12 revisions
Emscripten is a transpiler that transforms C++ code into webasm or javascript. It lets you convert C++ programs into webpages !
- Linux:
apt-get install emscripten
- Windows: see instructions here
$ git clone --recurse-submodules https://github.com/BrunoLevy/geogram.git
$ cd geogram
$ configure.sh Emscripten-clang
$ cd build/Emscripten-clang-Release
$ make -j 4
Now you need to create the webpage that encapsulates the application. There is in geogram a script for that:
$ cd build/Emscripten-clang-Release/bin
$ ../../tools/gen_emscripten_html.sh geobox
Unfortunately, you cannot just do $firefox geobox.html
, because most
webbrowser do not support directly loading local files, they want a webserver
for that ! But python has a builtin one that is easy to start:
$ python -m http.server &
$ firefox http://localhost:8000/geobox.html
- The scroll wheel for zooming is broken
- The
fullscreen
button is broken