-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit-script.sh
More file actions
26 lines (24 loc) · 834 Bytes
/
init-script.sh
File metadata and controls
26 lines (24 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if ! command -v wasm-pack &> /dev/null
then
echo "installing rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
else
echo "✓ rust exists"
fi
if ! command -v wasm-pack &> /dev/null
then
echo "installing wasm-pack..."
cargo install wasm-pack
exit
else
echo "✓ wasm-pack exists"
fi
rustup target add wasm32-unknown-unknown
rustup target add wasm32-unknown-emscripten
cd hakim-json
echo "building hakim json..."
EMCC_CFLAGS="-s TOTAL_STACK=32MB -s INITIAL_MEMORY=512MB" cargo build -vv --release --target wasm32-unknown-emscripten
cd ..
node scripts/patch-emscripten.js ./target/wasm32-unknown-emscripten/release/hakim-json.js
cp ./target/wasm32-unknown-emscripten/release/hakim-json.js ./front/static/.
cp ./target/wasm32-unknown-emscripten/release/hakim_json.wasm ./front/static/.