Browse Source

Make The Compiling for Web documentation more obvious

I updated the documentation with workaround if it's not compiling from my experience in Bug #11197, and thanks to the help of @eska014.
Camille Bissuel 8 years ago
parent
commit
7f16bf5098
1 changed files with 20 additions and 6 deletions
  1. 20 6
      development/compiling/compiling_for_web.rst

+ 20 - 6
development/compiling/compiling_for_web.rst

@@ -10,21 +10,31 @@ Requirements
 
 
 To compile export templates for the Web, the following is required:
 To compile export templates for the Web, the following is required:
 
 
--  `Emscripten SDK <http://emscripten.org/>`__ (Install in a path without
-   spaces, i.e. not on "Program Files")
--  `Python 2.7+ <https://www.python.org/>`__ (3.0 is
-   untested as of now)
+-  `Emscripten <http://emscripten.org/>`__, plus `LLVM <https://llvm.org/>`__ and `Binaryen <https://github.com/WebAssembly/binaryen>`__ if you want to compile for *Webassembly* (Godot 3). The easiest way to install them if they are not up to date in your Linux package manager is to use the `Emscripten SDK <http://emscripten.org/>`__ (Install in a path without spaces, i.e. not on "Program Files")
+-  `Python 2.7+ <https://www.python.org/>`__ (3.0 is untested as of now)
 -  `SCons <http://www.scons.org>`__ build system
 -  `SCons <http://www.scons.org>`__ build system
 
 
 Building export templates
 Building export templates
 -------------------------
 -------------------------
 
 
 Start a terminal and set the environment variable ``EMSCRIPTEN_ROOT`` to the
 Start a terminal and set the environment variable ``EMSCRIPTEN_ROOT`` to the
-installation directory of Emscripten::
+installation directory of Emscripten:
+
+-  If you installed Emscripten via the Emscripten SDK, you will declare the variable with a path to your downloaded folder:
 
 
     export EMSCRIPTEN_ROOT=~/emsdk/emscripten/master
     export EMSCRIPTEN_ROOT=~/emsdk/emscripten/master
+    
+-  If you installed Emscripten via your package manager, you can know the path with the ``em-config`` command
+
+    em-config EMSCRIPTEN_ROOT
+
+   So you will declare the variable as for example:
 
 
-If you are on Windows, start a regular prompt or the Emscripten Command Prompt.
+    export EMSCRIPTEN_ROOT=/usr/lib/emscripten
+    
+The Emscripten variables are defined in the ``~/.emscripten`` file, so this is an alternative way to check. Erase this file if you want to reinstall Emscripten with a fresh new method.
+
+If you are on Windows and used Emscripten SDK, start a regular prompt or the Emscripten Command Prompt.
 Do **not** use the Developer Command Prompt nor any of the ones that come with
 Do **not** use the Developer Command Prompt nor any of the ones that come with
 Visual Studio. You can set the environment variable in the system settings or
 Visual Studio. You can set the environment variable in the system settings or
 in the prompt itself::
 in the prompt itself::
@@ -43,6 +53,8 @@ the resulting file will be placed in the ``bin`` subdirectory. Its name is
 ``godot.javascript.opt.zip`` for release or ``godot.javascript.opt.debug.zip``
 ``godot.javascript.opt.zip`` for release or ``godot.javascript.opt.debug.zip``
 for debug.
 for debug.
 
 
+If it's not, check if you have properly installed everything, and if EMSCRIPTEN_ROOT path is correctly defined, including in the ``~/.emscripten`` file.
+
 Finally, rename the zip archive to ``javascript_release.zip`` for the
 Finally, rename the zip archive to ``javascript_release.zip`` for the
 release template::
 release template::
 
 
@@ -96,6 +108,8 @@ These commands will build WebAssembly export templates in either release or
 debug mode. The generated files' names contain ``.webassembly`` as an
 debug mode. The generated files' names contain ``.webassembly`` as an
 additional file suffix before the extension.
 additional file suffix before the extension.
 
 
+If it's not compiling, check if you have properly installed everything, and if ``LLVM_ROOT`` and ``BINARYEN_ROOT`` variables are defined in the ``~/.emscripten`` file. You can define the ``BINARYEN_ROOT`` path manually in this file if you already installed it and want to avoid Scons to compile it from ports during template compilation.
+
 Finally, the WebAssembly templates are renamed to ``webassembly_release.zip``
 Finally, the WebAssembly templates are renamed to ``webassembly_release.zip``
 and ``webassembly_debug.zip``::
 and ``webassembly_debug.zip``::