2021-03-05 12:12:59 -06:00
|
|
|
#!/usr/bin/env bash
|
2019-07-30 06:37:47 -05:00
|
|
|
|
2020-11-03 04:00:04 -06:00
|
|
|
dir=$(dirname "$0")
|
2020-11-27 13:48:53 -06:00
|
|
|
source "$dir/config.sh"
|
2020-01-15 11:05:18 -06:00
|
|
|
|
|
|
|
# read nightly compiler from rust-toolchain file
|
2021-03-29 03:45:09 -05:00
|
|
|
TOOLCHAIN=$(cat "$dir/rust-toolchain" | grep channel | sed "s/channel = \"\(.*\)\"/\1/")
|
2019-07-30 06:37:47 -05:00
|
|
|
|
|
|
|
cmd=$1
|
2020-11-03 04:00:04 -06:00
|
|
|
shift || true
|
2019-07-30 06:37:47 -05:00
|
|
|
|
2020-09-29 11:41:59 -05:00
|
|
|
if [[ "$cmd" = "jit" ]]; then
|
2020-12-27 03:30:38 -06:00
|
|
|
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
|
2020-11-27 13:48:53 -06:00
|
|
|
cargo "+${TOOLCHAIN}" "$cmd" "$@"
|
2020-09-29 11:41:59 -05:00
|
|
|
fi
|