Files
wasm/scripts/install-build-deps.sh
T
Jaco Greeff efbabc9c5c Cleanup build scripts (reusability) (#2)
* Cleanup build scripts (reusability)

* Adjustments

* More cleanups
2019-03-17 16:42:48 +01:00

29 lines
619 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# wasm2js for wasm -> asm.js
BINARYEN=( "wasm-opt" )
# 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