git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

scripts/check-wasm (1.2K)

 1 #!/usr/bin/env bash
 2 # check-wasm — does the portable part of cce-ui still build for the browser?
 3 # Type-checks the library for wasm32-unknown-unknown, with and without the
 4 # optional features. The native shell and renderer (Wayland, Vulkan, the
 5 # compositor IPC) are cfg'd out there; everything else must compile, and a
 6 # change that reaches for one of them from portable code fails here first.
 7 # The browser shell and renderer (src/web), the probe's browser half and the
 8 # reference app's (examples/demo_web.rs) build here too;
 9 # they need web-sys's unstable WebGPU bindings, switched on for this crate in
10 # .cargo/config.toml — which cargo reads from the directory it runs in, hence
11 # the cd below.
12 set -euo pipefail
13 cd "$(dirname "$0")/.."
14 if ! rustup target list --installed 2>/dev/null | grep -qx wasm32-unknown-unknown; then
15     echo "check-wasm: the wasm32-unknown-unknown target is not installed:" >&2
16     echo "    rustup target add wasm32-unknown-unknown" >&2
17     exit 2
18 fi
19 cargo check --lib --target wasm32-unknown-unknown
20 cargo check --lib --target wasm32-unknown-unknown --features markdown,doc_editor
21 cargo check --example probe_web --example demo_web --example compute_web --example probe3d_web --target wasm32-unknown-unknown
22 echo "check-wasm: ok"