Use new emscripten when building with docker
This commit is contained in:
parent
b118e7d750
commit
751ffd2ee1
3 changed files with 13 additions and 7 deletions
|
|
@ -64,11 +64,11 @@ emcc=
|
|||
if which emcc > /dev/null && [[ "$force_docker" == "0" ]]; then
|
||||
emcc=emcc
|
||||
elif which docker > /dev/null; then
|
||||
emcc="docker run \
|
||||
--rm \
|
||||
-v $(pwd):/src:Z \
|
||||
-u $(id -u) \
|
||||
trzeci/emscripten-slim \
|
||||
emcc="docker run \
|
||||
--rm \
|
||||
-v $(pwd):/src:Z \
|
||||
-u $(id -u) \
|
||||
emscripten/emsdk \
|
||||
emcc"
|
||||
else
|
||||
echo 'You must have either `docker` or `emcc` on your PATH to run this script'
|
||||
|
|
|
|||
|
|
@ -4,6 +4,12 @@ set -e
|
|||
|
||||
cargo build --release
|
||||
|
||||
build_wasm_args=
|
||||
if [[ $1 == "--docker" ]]; then
|
||||
build_wasm_args="--docker"
|
||||
shift
|
||||
fi
|
||||
|
||||
filter_grammar_name=$1
|
||||
|
||||
root_dir=$PWD
|
||||
|
|
@ -20,7 +26,7 @@ while read -r grammar_file; do
|
|||
fi
|
||||
|
||||
echo "Compiling ${grammar_name} parser to wasm"
|
||||
"$tree_sitter" build-wasm $grammar_dir
|
||||
"$tree_sitter" build-wasm $build_wasm_args $grammar_dir
|
||||
done <<< "$grammar_files"
|
||||
|
||||
mv tree-sitter-*.wasm target/release/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue