2021-02-14 14:43:23 +01:00
|
|
|
#!/usr/bin/env bash
|
2019-07-30 13:37:47 +02:00
|
|
|
|
2020-11-02 18:16:57 +01:00
|
|
|
dir=$(dirname "$0")
|
2020-11-04 15:35:42 +01:00
|
|
|
source "$dir/config.sh"
|
2020-01-15 12:05:18 -05:00
|
|
|
|
|
|
|
# read nightly compiler from rust-toolchain file
|
2020-11-27 18:05:05 +01:00
|
|
|
TOOLCHAIN=$(cat "$dir/rust-toolchain")
|
2019-07-30 13:37:47 +02:00
|
|
|
|
|
|
|
cmd=$1
|
2020-11-02 18:16:57 +01:00
|
|
|
shift || true
|
2019-07-30 13:37:47 +02:00
|
|
|
|
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-12-25 12:13:11 +01:00
|
|
|
elif [[ "$cmd" = "lazy-jit" ]]; then
|
|
|
|
cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit-lazy -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
|