How to build web version of easyrpg player?

I really like easyrpg player, but it’s not easy for me to understand how to compile it :slight_smile:

Could anyone describe steps how to compile js/wasm version of easyrpg player please?

OS doesn’t matter, I will install windows/any linux if needed.

Hello.
We only support building it on Linux (you can also use WSL on Windows for this).

First run the 0.sh script from this repository:

If the script fails you probably miss some packages such as pkg-config, unzip or patch.

When the script fails due to this run “3.sh” and then “0.sh” again.


Now about building Player. Run the following cmake command in the Player repository:

TOOLCHAIN_DIR is the path of the emscripten directory that contains “0.sh” etc.

cmake . -GNinja -Bbuild \
  -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_DIR/emsdk-portable/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
  -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \
  -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \
  -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \
  -DCMAKE_PREFIX_PATH="$TOOLCHAIN_DIR" \
  -DCMAKE_INSTALL_PREFIX=output -DCMAKE_BUILD_TYPE=Release \
  -DPLAYER_BUILD_LIBLCF=ON \
  -DPLAYER_JS_BUILD_SHELL=ON"

Then build and install:

cmake --build build --target install

The output dir will contain the files you need.

Ghabry, thank you very much!

If somebody gonna build it on Ubuntu - there’s command to install all necessary packages:
sudo apt install git curl autoconf libtool build-essential cmake ninja-build

1 Like