|
1 | | -# EasyRPG buildscripts |
| 1 | +# Emscripten buildscript |
| 2 | + |
| 3 | +This repository provides build files to easily compile the libraries used by |
| 4 | +the EasyRPG project for emscripten (web). |
| 5 | + |
| 6 | +## Requirements |
| 7 | + |
| 8 | +Only Linux and macOS are supported. On Windows, consider using WSL2 (install |
| 9 | +Ubuntu through the Windows Store). |
| 10 | + |
| 11 | +## In this repository |
| 12 | + |
| 13 | +To build `liblcf` as part of the buildscripts, set the environment variable |
| 14 | +`BUILD_LIBLCF` to `1`: |
| 15 | + |
| 16 | +``` |
| 17 | +export BUILD_LIBLCF=1 |
| 18 | +``` |
| 19 | + |
| 20 | +Run `0_build_everything.sh` to obtain all the necessary dependencies: |
| 21 | + |
| 22 | +``` |
| 23 | +./0_build_everything.sh |
| 24 | +``` |
| 25 | + |
| 26 | +Building will take a while. |
| 27 | + |
| 28 | +## In the Player repository |
| 29 | + |
| 30 | +### Configuring |
| 31 | + |
| 32 | +**Option 1**: In `builds/cmake/CMakePresetsUser.json`, set |
| 33 | +`EASYRPG_BUILDSCRIPTS` to the path of the buildscripts repository. |
| 34 | + |
| 35 | +**Option 2**: Set the environment variable `EASYRPG_BUILDSCRIPTS` to the path |
| 36 | +of the buildscripts repository: |
| 37 | + |
| 38 | +``` |
| 39 | +export EASYRPG_BUILDSCRIPTS=/path/to/buildscripts |
| 40 | +``` |
| 41 | + |
| 42 | +To configure the Player, run: |
| 43 | + |
| 44 | +``` |
| 45 | +cmake --preset emscripten-[BUILD_TYPE] |
| 46 | +``` |
| 47 | + |
| 48 | +Options for ``[BUILD_TYPE]``: |
| 49 | + |
| 50 | +- `debug`: Debug build |
| 51 | +- `relwithdebinfo`: Release build with debug symbols |
| 52 | +- `release`: Release build without debug symbols (recommended) |
| 53 | + |
| 54 | +Other useful options: |
| 55 | + |
| 56 | +- `-DPLAYER_BUILD_LIBLCF=ON`: Builds `liblcf` if you haven't compiled it as |
| 57 | +part of the buildscripts |
| 58 | +- `-DPLAYER_JS_OUTPUT_NAME=index`: By default, the resulting file is called |
| 59 | +`easyrpg-player.html`. This option names it `index.html`. |
| 60 | + |
| 61 | +### Building |
| 62 | + |
| 63 | +To build the Player run: |
| 64 | + |
| 65 | +``` |
| 66 | +cmake --build --preset=[PRESET] |
| 67 | +``` |
| 68 | + |
| 69 | +`[PRESET]` should match the value used after `--preset` in the configure step. |
| 70 | + |
| 71 | +The resulting HTML, JS, and WASM files will be located in `build/[PRESET]`. |
| 72 | + |
| 73 | +Copy them to their own directory and place any games inside a `games/` subdirectory. |
| 74 | + |
| 75 | +### Deployment |
| 76 | + |
| 77 | +For further information, read our [web player set up guide]. |
| 78 | + |
| 79 | +[web player set up guide]: https://easyrpg.org/player/guide/webplayer/ |
2 | 80 |
|
3 | | -## Emscripten specifics |
|
0 commit comments