mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
40 lines
964 B
Bash
Executable File
40 lines
964 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
webgl_flag=""
|
|
|
|
TEMP=$(getopt --long -o "g" "$@")
|
|
eval set -- "$TEMP"
|
|
while true; do
|
|
case "$1" in
|
|
-g)
|
|
webgl_flag="web-webgl,"
|
|
shift 2
|
|
;;
|
|
*)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
|
|
export RUSTUP_TOOLCHAIN=nightly-2022-04-04-x86_64-unknown-linux-gnu
|
|
|
|
rustup component add rust-src --toolchain nightly-2022-04-04-x86_64-unknown-linux-gnu
|
|
|
|
function plain_build() {
|
|
cargo build --features "$webgl_flag" --target wasm32-unknown-unknown -Z build-std=std,panic_abort
|
|
# TODO: Untested: --reference-types
|
|
wasm-bindgen --target web --out-dir dist/mapr-pain-bindgen target/wasm32-unknown-unknown/debug/mapr.wasm
|
|
}
|
|
|
|
function wasm_pack_build() {
|
|
~/Downloads/wasm-pack-v0.10.1-x86_64-unknown-linux-musl/wasm-pack build . \
|
|
--release --target web --out-dir dist/mapr -- \
|
|
--features "$webgl_flag" -Z build-std=std,panic_abort
|
|
}
|
|
|
|
wasm_pack_build
|
|
|
|
#xdg-open "https://localhost:5555/web/mapr.html"
|
|
#python3 tools/tls-http-server.py
|