Files
harfbuzz/util/gpu/web/build.sh
T
Behdad EsfahbodandClaude Opus 4.6 468bbb1b5d [gpu] Use -Oz for web demo build
Reduces wasm size from 687K to 593K.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 11:14:51 -06:00

38 lines
875 B
Bash
Executable File

#!/bin/sh
# Build the hb-gpu web demo with Emscripten.
# Prerequisites: source emsdk/emsdk_env.sh
set -e
SRCDIR="$(cd "$(dirname "$0")/../../.." && pwd)"
OUTDIR="$(dirname "$0")/out"
mkdir -p "$OUTDIR"
em++ \
-std=c++17 \
-Oz -flto \
-I"$SRCDIR/src" \
-DHB_NO_MT \
-DHAVE_ROUND \
-DHB_GPU_ATLAS_2D \
-DHB_HAS_GPU \
"$SRCDIR/src/harfbuzz-world.cc" \
"$SRCDIR/util/gpu/demo-atlas.cc" \
"$SRCDIR/util/gpu/demo-buffer.cc" \
"$SRCDIR/util/gpu/demo-font.cc" \
"$SRCDIR/util/gpu/demo-glstate.cc" \
"$SRCDIR/util/gpu/demo-shader.cc" \
"$SRCDIR/util/gpu/demo-view.cc" \
"$SRCDIR/util/gpu/web/hb-gpu-web.cc" \
-sUSE_GLFW=3 \
-sUSE_WEBGL2=1 \
-sFULL_ES3=1 \
-sALLOW_MEMORY_GROWTH=1 \
--shell-file "$SRCDIR/util/gpu/web/shell.html" \
-o "$OUTDIR/index.html"
echo "Built: $OUTDIR/index.html"
echo "Serve: python3 -m http.server -d $OUTDIR"