mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-21 14:53:02 +01:00
Emscripten: build in CI
This commit is contained in:
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@@ -627,6 +627,28 @@ jobs:
|
|||||||
name: OpenRCT2-${{ needs.build_variables.outputs.name }}-Android
|
name: OpenRCT2-${{ needs.build_variables.outputs.name }}-Android
|
||||||
path: artifacts
|
path: artifacts
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
emscripten:
|
||||||
|
name: Emscripten
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [check-code-formatting, build_variables]
|
||||||
|
container: openrct2/openrct2-build:19-emscripten
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||||
|
with:
|
||||||
|
key: emscripten
|
||||||
|
- name: Install GCC problem matcher
|
||||||
|
uses: ammaraskar/gcc-problem-matcher@master
|
||||||
|
- name: Build OpenRCT2
|
||||||
|
run: |
|
||||||
|
. scripts/setenv
|
||||||
|
build-emscripten
|
||||||
|
- name: Upload artifacts (CI)
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: OpenRCT2-${{ needs.build_variables.outputs.name }}-emscripten
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
36
scripts/build-emscripten
Executable file
36
scripts/build-emscripten
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
|
||||||
|
START_DIR=$(pwd)
|
||||||
|
SPEEXDSP_ROOT=/ext/speexdsp
|
||||||
|
ICU_ROOT=/ext/icu/icu4c/source
|
||||||
|
LIBZIP_ROOT=/ext/libzip
|
||||||
|
JSON_DIR=/usr/include/nlohmann/
|
||||||
|
|
||||||
|
emcmake cmake ../ \
|
||||||
|
-G Ninja \
|
||||||
|
-DDISABLE_NETWORK=ON \
|
||||||
|
-DDISABLE_HTTP=ON \
|
||||||
|
-DDISABLE_TTF=ON \
|
||||||
|
-DDISABLE_FLAC=ON \
|
||||||
|
-DDISABLE_DISCORD_RPC=ON \
|
||||||
|
-DCMAKE_SYSTEM_NAME=Emscripten \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DSPEEXDSP_INCLUDE_DIR="$SPEEXDSP_ROOT/include/" \
|
||||||
|
-DSPEEXDSP_LIBRARY="$SPEEXDSP_ROOT/libspeexdsp/.libs/libspeexdsp.a" \
|
||||||
|
-DICU_INCLUDE_DIR="$ICU_ROOT/common" \
|
||||||
|
-DICU_DATA_LIBRARIES=$ICU_ROOT/lib/libicuuc.so \
|
||||||
|
-DICU_DT_LIBRARY_RELEASE="$ICU_ROOT/stubdata/libicudata.so" \
|
||||||
|
-DLIBZIP_LIBRARIES="$LIBZIP_ROOT/build/lib/libzip.a" \
|
||||||
|
-DEMSCRIPTEN_FLAGS="-s USE_SDL=2 -s USE_BZIP2=1 -s USE_LIBPNG=1 -pthread -O3" \
|
||||||
|
-DEMSCRIPTEN_LDFLAGS="-Wno-pthreads-mem-growth -s ASYNCIFY -s FULL_ES3 -s SAFE_HEAP=0 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s INITIAL_MEMORY=2GB -s MAX_WEBGL_VERSION=2 -s PTHREAD_POOL_SIZE=120 -pthread -sEXPORTED_RUNTIME_METHODS=FS,callMain,UTF8ToString,stringToNewUTF8 -lidbfs.js --use-preload-plugins -s MODULARIZE=1 -s 'EXPORT_NAME=\"OPENRCT2_WEB\"'"
|
||||||
|
|
||||||
|
emmake ninja
|
||||||
|
|
||||||
|
rm -rf www/
|
||||||
|
mkdir -p www/
|
||||||
|
cd www/
|
||||||
|
cp -r ../openrct2.* ./
|
||||||
|
cp -r ../../emscripten/static/* ./
|
||||||
Reference in New Issue
Block a user