summaryrefslogtreecommitdiff
path: root/2026/submissions/threecoff/clennis/scripts/setup-emsdk.sh
blob: b711b7fd18f9461f5f756a3da3bd32325b983c22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
# Install the Emscripten SDK into ./vendor/emsdk (needed only for the web build).
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
EMSDK_DIR="$ROOT/vendor/emsdk"

if [ ! -d "$EMSDK_DIR" ]; then
    echo ">> Cloning emsdk into $EMSDK_DIR"
    git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$EMSDK_DIR"
fi

cd "$EMSDK_DIR"
echo ">> Installing latest Emscripten toolchain (large download)..."
./emsdk install latest
./emsdk activate latest

echo
echo ">> Done. Activate it in your shell with:"
echo "     source $EMSDK_DIR/emsdk_env.sh"