mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 12:25:02 +01:00
vendor
This commit is contained in:
parent
12163d1338
commit
550b1644cb
363 changed files with 84081 additions and 16 deletions
45
egui/scripts/wasm_bindgen_check.sh
Executable file
45
egui/scripts/wasm_bindgen_check.sh
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
cd "$script_path/.."
|
||||
|
||||
if [[ $* == --skip-setup ]]
|
||||
then
|
||||
echo "Skipping setup_web.sh"
|
||||
else
|
||||
echo "Running setup_web.sh"
|
||||
./scripts/setup_web.sh
|
||||
fi
|
||||
|
||||
CRATE_NAME="egui_demo_app"
|
||||
FEATURES="glow,http,persistence,web_screen_reader"
|
||||
|
||||
# This is required to enable the web_sys clipboard API which eframe web uses
|
||||
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
|
||||
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
|
||||
export RUSTFLAGS=--cfg=web_sys_unstable_apis
|
||||
|
||||
echo "Building rust…"
|
||||
BUILD=debug # debug builds are faster
|
||||
|
||||
(cd crates/$CRATE_NAME &&
|
||||
cargo build \
|
||||
--lib \
|
||||
--target wasm32-unknown-unknown \
|
||||
--no-default-features \
|
||||
--features ${FEATURES}
|
||||
)
|
||||
|
||||
TARGET="target"
|
||||
|
||||
echo "Generating JS bindings for wasm…"
|
||||
|
||||
rm -f "${CRATE_NAME}_bg.wasm" # Remove old output (if any)
|
||||
|
||||
TARGET_NAME="${CRATE_NAME}.wasm"
|
||||
wasm-bindgen "${TARGET}/wasm32-unknown-unknown/$BUILD/$TARGET_NAME" \
|
||||
--out-dir . --no-modules --no-typescript
|
||||
|
||||
# Remove output:
|
||||
rm -f "${CRATE_NAME}_bg.wasm"
|
||||
rm -f "${CRATE_NAME}.js"
|
||||
Loading…
Add table
Add a link
Reference in a new issue