2022-06-08 01:05:04 +01:00
|
|
|
#!/bin/bash
|
2022-06-12 22:30:14 +01:00
|
|
|
if [ -n "$1" ]; then
|
|
|
|
if [ "$1" == "--help" ]; then
|
|
|
|
echo "Usage:
|
|
|
|
$0 [decky|crankshaft|<nothing>]"
|
|
|
|
exit 0
|
|
|
|
elif [ "$1" == "decky" ]; then
|
|
|
|
echo "Building WASM module for decky framework"
|
2022-12-03 22:32:37 +00:00
|
|
|
RUSTFLAGS="--cfg aes_compact" wasm-pack build --target web --features decky,$2
|
2022-06-12 22:30:14 +01:00
|
|
|
elif [ "$1" == "crankshaft" ]; then
|
|
|
|
echo "WARNING: crankshaft support is unimplemented"
|
2022-12-03 22:32:37 +00:00
|
|
|
RUSTFLAGS="--cfg aes_compact" wasm-pack build --target web --features crankshaft,$2
|
2022-06-12 22:30:14 +01:00
|
|
|
else
|
|
|
|
echo "Unsupported plugin framework \`$1\`"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "WARNING: Building for any plugin framework, which may not work for every framework"
|
2022-12-03 22:32:37 +00:00
|
|
|
RUSTFLAGS="--cfg aes_compact" wasm-pack build --target web --features debug,$2
|
2022-06-12 22:30:14 +01:00
|
|
|
fi
|
2022-06-08 01:05:04 +01:00
|
|
|
|
2022-06-12 22:30:14 +01:00
|
|
|
python3 ./scripts/generate_embedded_wasm.py
|