mcpe/build-wasm.sh

43 lines
723 B
Bash
Raw Normal View History

2023-08-05 01:58:24 -04:00
#!/bin/bash
set -e
# Working Directory
mkdir -p wasm
cd wasm
# Clone Emscripten SDK
if [ ! -d emsdk ]; then
git clone https://github.com/emscripten-core/emsdk.git
fi
cd emsdk
# Update Emscripten SDK
git pull
2023-10-10 15:25:03 -04:00
./emsdk install latest
./emsdk activate latest > /dev/null
2023-08-05 01:58:24 -04:00
# Use Emscripten SDK
export EMSDK_QUIET=1
source ./emsdk_env.sh
# Create Output Directory
cd ../
rm -rf dist
mkdir dist
# Create Build Directory
mkdir -p build
cd build
# Configure Build
emcmake cmake -GNinja "$@" ../../platforms/sdl
# Build
cmake --build .
# Bundle
cp reminecraftpe.* ../dist
2023-10-10 15:25:03 -04:00
cp ../../platforms/sdl/emscripten/wasm_shell.html ../dist/reminecraftpe.html
2023-08-05 01:58:24 -04:00
cp ../../thirdparty/coi-serviceworker/coi-serviceworker.min.js ../dist