-
Notifications
You must be signed in to change notification settings - Fork 54
CMake Emscripten (Linux) setup
See: https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html
Open a terminal:
cd EMSCRIPTEN_INSTALL_DIR (your emscripten root directory)
source emsdk_env.sh
Some thirdparty libraries are registered as submodules, you need to install them before compiling.
cd GPlayEngine
git submodule init
git submodule update
Third-party libraries are built independently of GPlayEngine and must be builded before anything.
This step is also necessary to prepare output directories.
Run the following from the top-level directory of your GPlayEngine repository:
cd thirdparty
mkdir BUILD
cd BUILD
emcmake cmake ..
make -j12 (X number should be 1.5x the number of cores you have)
Game data need to be embedded in a file that will be preloaded into Emscripten’s virtual file system. Game data file is created at build time from content of "emdata" directory: (or adjust path in CMakeList.txt)
- Before compiling, in the output/bin directory, create a new dir named "emdata"
- Copy inside the GPlayEngine "res" directory
- Remove default data directory and create a new one.
- Copy inside only required assets your game need.
Run the following from the top-level directory of your GPlayEngine repository:
mkdir BUILD
cd BUILD
emcmake cmake ..
make -j12 (X number should be 1.5x the number of cores you have)
In the output/bin directory, open the minimal.sample.html file with your web browser.