rust/scripts/cargo.sh

19 lines
439 B
Bash
Raw Normal View History

#!/usr/bin/env bash
dir=$(dirname "$0")
source "$dir/config.sh"
# read nightly compiler from rust-toolchain file
TOOLCHAIN=$(cat "$dir/rust-toolchain")
cmd=$1
shift || true
2020-09-29 11:41:59 -05:00
if [[ "$cmd" = "jit" ]]; then
cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit -Cprefer-dynamic
elif [[ "$cmd" = "lazy-jit" ]]; then
cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit-lazy -Cprefer-dynamic
2020-09-29 11:41:59 -05:00
else
cargo "+${TOOLCHAIN}" "$cmd" "$@"
2020-09-29 11:41:59 -05:00
fi