Update HTML5 platform docs

This commit is contained in:
Leon Krause
2019-01-23 20:41:48 +01:00
parent 82ffb39992
commit 4cb5df447b
6 changed files with 458 additions and 301 deletions

View File

@@ -10,7 +10,7 @@ Requirements
To compile export templates for the Web, the following is required:
- `Emscripten 1.37.9+ <http://kripken.github.io/emscripten-site>`__: If the version available
- `Emscripten 1.38.22+ <http://kripken.github.io/emscripten-site>`__: If the version available
per package manager is not recent enough, the best alternative is to install
using the `Emscripten SDK <http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html>`__
- `Python 2.7+ or Python 3.5+ <https://www.python.org/>`__
@@ -29,6 +29,11 @@ written by the Emscripten SDK, e.g. when invoking ``emsdk activate latest``,
or by your package manager. It's also created when starting Emscripten's
``emcc`` program if the file doesn't exist.
.. Attention::
On Windows, make sure to escape backslashes of paths within the Emscripten
configuration file as double backslashes ``\\`` or use Unix-style paths with a
single forward slash ``/``.
Open a terminal and navigate to the root directory of the engine source code.
Then instruct SCons to build the JavaScript platform. Specify ``target`` as
either ``release`` for a release build or ``release_debug`` for a debug build::
@@ -66,18 +71,13 @@ asm.js, a highly optimizable subset of JavaScript, using Emscripten's
tool called ``asm2wasm``. Emscripten automatically takes care of both
processes, we simply run SCons.
The other method uses LLVM's WebAssembly backend. This backend is not yet
available in release versions of LLVM, only in development builds built with
``LLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly``.
Compiling with this backend outputs files in LLVM's ``.s`` format, which is
translated into actual WebAssembly using a tool called ``s2wasm``.
Emscripten manages these processes as well, so we just invoke SCons.
The other method uses LLVM's WebAssembly backend. This backend is available
starting with LLVM 8 or in development builds.
Emscripten manages this process as well, so we just invoke SCons.
In order to choose one of the two methods, the ``LLVM_ROOT`` variable in the
Emscripten configuration file is used. If it points to a directory containing
binaries of Emscripten's *fastcomp* fork of clang, ``asm2wasm`` is used.
This is the default in a normal Emscripten installation. Otherwise,
LLVM binaries built with the WebAssembly backend will be expected and
``s2wasm`` is used. On Windows, make sure to escape backslashes of paths within
this file as double backslashes ``\\`` or use Unix-style paths with a single
forward slash ``/``.
the LLVM's WebAssembly backend is used.