rust/scripts/cargo.sh

17 lines
315 B
Bash
Raw Normal View History

#!/bin/bash
2020-11-02 18:16:57 +01:00
dir=$(dirname "$0")
source "$dir/config.sh"
# read nightly compiler from rust-toolchain file
TOOLCHAIN=$(cat "$dir/rust-toolchain")
cmd=$1
2020-11-02 18:16:57 +01:00
shift || true
2020-09-29 18:41:59 +02:00
if [[ "$cmd" = "jit" ]]; then
2020-12-25 11:31:33 +01:00
cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit -Cprefer-dynamic
2020-09-29 18:41:59 +02:00
else
2020-11-04 15:59:20 +01:00
cargo "+${TOOLCHAIN}" "$cmd" "$@"
2020-09-29 18:41:59 +02:00
fi