mirror of
https://github.com/ReMinecraftPE/mcpe.git
synced 2025-01-22 09:11:56 -05:00
42 lines
723 B
Bash
Executable file
42 lines
723 B
Bash
Executable file
#!/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
|
|
./emsdk install latest
|
|
./emsdk activate latest > /dev/null
|
|
|
|
# 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
|
|
cp ../../platforms/sdl/emscripten/wasm_shell.html ../dist/reminecraftpe.html
|
|
cp ../../thirdparty/coi-serviceworker/coi-serviceworker.min.js ../dist
|