rust/scripts/cargo.sh
2020-12-25 11:31:33 +01:00

16 lines
315 B
Bash
Executable file

#!/bin/bash
dir=$(dirname "$0")
source "$dir/config.sh"
# read nightly compiler from rust-toolchain file
TOOLCHAIN=$(cat "$dir/rust-toolchain")
cmd=$1
shift || true
if [[ "$cmd" = "jit" ]]; then
cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit -Cprefer-dynamic
else
cargo "+${TOOLCHAIN}" "$cmd" "$@"
fi