egui/build.sh

30 lines
588 B
Bash
Raw Normal View History

#!/bin/bash
set -eu
# Pre-requisites:
rustup target add wasm32-unknown-unknown
if ! [[ $(wasm-bindgen --version) ]]; then
2018-12-30 10:01:14 +00:00
cargo install -f wasm-bindgen-cli
fi
BUILD=debug
# BUILD=release
# Clear output from old stuff:
rm -rf docs/*.wasm
2018-12-23 23:15:18 +00:00
function build_rust
{
echo "Build rust:"
cargo build --target wasm32-unknown-unknown
echo "Generate JS bindings for wasm:"
FOLDER_NAME=${PWD##*/}
2019-01-04 13:14:32 +00:00
TARGET_NAME="emgui_wasm.wasm"
2018-12-23 23:15:18 +00:00
wasm-bindgen "target/wasm32-unknown-unknown/$BUILD/$TARGET_NAME" \
--out-dir docs --no-modules --no-typescript
2018-12-23 23:15:18 +00:00
# --no-modules-global hoboho
}
2018-12-23 23:15:18 +00:00
build_rust