Files
wasm/scripts/install-build-deps.sh
T
Jaco Greeff 72d4ec56b5 Add asm.js generation with CRYPTO_ASM env var (#23)
* Add asm.js generation, import via index-asm.js

* Less sed-y, more babel-y

* Throw error when some failed

* CRYPTO_ASM env flag

* CHANGELOG
2019-07-18 15:38:50 +02:00

29 lines
629 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# wasm2js for wasm -> asm.js
BINARYEN=( "wasm-opt" "wasm2js" )
# install wasm-pack as required
if ! [ -x "$(command -v wasm-pack)" ]; then
echo "*** Installing wasm-pack"
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
fi
# install binaryen as required
if [ ! -d "binaryen" ]; then
echo "*** Installing binaryen"
git clone --recursive https://github.com/WebAssembly/binaryen.git
rm -rf binaryen/test
fi
for BIN in "${BINARYEN[@]}"; do
if [ ! -f "binaryen/bin/$BIN" ]; then
echo "*** Building $BIN"
cd binaryen
cmake . && make $BIN
cd ..
fi
done