From 494443cf2acfc92136365ad8029a600e9432b7c7 Mon Sep 17 00:00:00 2001 From: Emi Socks Date: Tue, 24 Feb 2026 09:47:42 +0100 Subject: [PATCH 1/2] Add emscripten build instructions --- emscripten/README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/emscripten/README.md b/emscripten/README.md index d7f07358c..0816a3f8a 100644 --- a/emscripten/README.md +++ b/emscripten/README.md @@ -1,3 +1,16 @@ # EasyRPG buildscripts -## Emscripten specifics +## Building EasyRPG player with emscripten + +In this repo: +- Run `0_build_everything.sh` to build all the necessary dependencies. + - Set the environment variable `BUILD_LIBLCF` to `1` to also build `liblcf`. +- An `emsdk_portable` directory should have been created. Run `emsdk_env.sh` in it to add `emsdk` to the path. +- Run `emsdk activate`. + +In the player repo: +- In `builds/cmake/CMakePresetsUser.json`, set `EASYRPG_BUILDSCRIPTS` to the path to the buildscripts repo. +- Run `emcmake cmake --preset=emscripten-release .` to configure the build. + - By default, the resulting file is called `easyrpg-player.html`. To name it `index.html` instead, use the `-DPLAYER_JS_OUTPUT_NAME=index` option. +- Run `emcmake cmake --build --preset=emscripten-release`. +- The resulting html, js and wasm files should be in `build/emscripten-release`. Copy them to their own directory and place any games inside a `games/` subdir. From 2c9c5e685ec6f4d772d2a09c169c8316ffd232cc Mon Sep 17 00:00:00 2001 From: Ghabry Date: Tue, 24 Feb 2026 12:02:42 +0100 Subject: [PATCH 2/2] Update wording based on the Windows Readme --- emscripten/README.md | 96 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 80 insertions(+), 16 deletions(-) diff --git a/emscripten/README.md b/emscripten/README.md index 0816a3f8a..529a539a5 100644 --- a/emscripten/README.md +++ b/emscripten/README.md @@ -1,16 +1,80 @@ -# EasyRPG buildscripts - -## Building EasyRPG player with emscripten - -In this repo: -- Run `0_build_everything.sh` to build all the necessary dependencies. - - Set the environment variable `BUILD_LIBLCF` to `1` to also build `liblcf`. -- An `emsdk_portable` directory should have been created. Run `emsdk_env.sh` in it to add `emsdk` to the path. -- Run `emsdk activate`. - -In the player repo: -- In `builds/cmake/CMakePresetsUser.json`, set `EASYRPG_BUILDSCRIPTS` to the path to the buildscripts repo. -- Run `emcmake cmake --preset=emscripten-release .` to configure the build. - - By default, the resulting file is called `easyrpg-player.html`. To name it `index.html` instead, use the `-DPLAYER_JS_OUTPUT_NAME=index` option. -- Run `emcmake cmake --build --preset=emscripten-release`. -- The resulting html, js and wasm files should be in `build/emscripten-release`. Copy them to their own directory and place any games inside a `games/` subdir. +# Emscripten buildscript + +This repository provides build files to easily compile the libraries used by +the EasyRPG project for emscripten (web). + +## Requirements + +Only Linux and macOS are supported. On Windows, consider using WSL2 (install +Ubuntu through the Windows Store). + +## In this repository + +To build `liblcf` as part of the buildscripts, set the environment variable +`BUILD_LIBLCF` to `1`: + +``` +export BUILD_LIBLCF=1 +``` + +Run `0_build_everything.sh` to obtain all the necessary dependencies: + +``` +./0_build_everything.sh +``` + +Building will take a while. + +## In the Player repository + +### Configuring + +**Option 1**: In `builds/cmake/CMakePresetsUser.json`, set +`EASYRPG_BUILDSCRIPTS` to the path of the buildscripts repository. + +**Option 2**: Set the environment variable `EASYRPG_BUILDSCRIPTS` to the path +of the buildscripts repository: + +``` +export EASYRPG_BUILDSCRIPTS=/path/to/buildscripts +``` + +To configure the Player, run: + +``` +cmake --preset emscripten-[BUILD_TYPE] +``` + +Options for ``[BUILD_TYPE]``: + +- `debug`: Debug build +- `relwithdebinfo`: Release build with debug symbols +- `release`: Release build without debug symbols (recommended) + +Other useful options: + +- `-DPLAYER_BUILD_LIBLCF=ON`: Builds `liblcf` if you haven't compiled it as +part of the buildscripts +- `-DPLAYER_JS_OUTPUT_NAME=index`: By default, the resulting file is called +`easyrpg-player.html`. This option names it `index.html`. + +### Building + +To build the Player run: + +``` +cmake --build --preset=[PRESET] +``` + +`[PRESET]` should match the value used after `--preset` in the configure step. + +The resulting HTML, JS, and WASM files will be located in `build/[PRESET]`. + +Copy them to their own directory and place any games inside a `games/` subdirectory. + +### Deployment + +For further information, read our [web player set up guide]. + +[web player set up guide]: https://easyrpg.org/player/guide/webplayer/ +