#!/usr/bin/env bash # Build the browser driver (led-simulator/web/wasm/led_driver.*) and the pattern gallery engine (led_fx.*) # with Emscripten in Docker: nothing to install on the host. Runs as the container's root, like the Makefile's # DOCKER_RUN (on rootless Docker that is you on the host). set -euo pipefail IMAGE="${EMSDK_IMAGE:-emscripten/emsdk:4.0.12}" here="$(cd "$(dirname "$0")" && pwd)" root="$(cd "$here/.." && pwd)" # led-controller: the build reads led-driver/ and desktop/ rel="${here#"$root"/}" docker run --rm -v "$root:/src" -w "/src/$rel" "$IMAGE" \ bash -c 'emcmake cmake -S . -B build -DCMAKE_BUILD_TYPE=Release >/dev/null && cmake --build build -j"$(nproc)"' ls -l "$root/led-simulator/web/wasm"