set --target when building miri

This helps cargo tell apart `./miri` builds and `cargo check` (e.g. through rust-analyzer).
See https://github.com/rust-lang/cargo/issues/8440.
This commit is contained in:
Ralf Jung 2020-07-03 11:18:44 +02:00
parent fd81012477
commit e310e2f0b9

8
miri
View File

@ -94,12 +94,12 @@ COMMAND="$1"
# <https://github.com/rust-lang/cargo/issues/6992>.
case "$COMMAND" in
*-debug)
CARGO_INSTALL_FLAGS="--debug $CARGO_EXTRA_FLAGS"
CARGO_BUILD_FLAGS="$CARGO_EXTRA_FLAGS"
CARGO_INSTALL_FLAGS="--target $TARGET --debug $CARGO_EXTRA_FLAGS"
CARGO_BUILD_FLAGS="--target $TARGET $CARGO_EXTRA_FLAGS"
;;
*)
CARGO_INSTALL_FLAGS="$CARGO_EXTRA_FLAGS"
CARGO_BUILD_FLAGS="--release $CARGO_EXTRA_FLAGS"
CARGO_INSTALL_FLAGS="--target $TARGET $CARGO_EXTRA_FLAGS"
CARGO_BUILD_FLAGS="--target $TARGET --release $CARGO_EXTRA_FLAGS"
;;
esac