blob: 48aff4917865414ef8990822b9256ced93359e20 [file] [log] [blame]
#!/bin/bash
# extended cargo build script
# if MT_RUSTC_WRAPPER is not empty, use it as rustc
RUSTC="${MT_RUSTC_WRAPPER:-${RUSTC}}"
if [ ! -z "${MUTE_CARGO}" ]; then
RUSTC="${RUSTC}" cargo build "$@" >/dev/null 2>&1
else
RUSTC="${RUSTC}" cargo build "$@"
fi
# if CLP is set, run cargo clippy after cargo build
# cannot use MT_RUSTC_WRAPPER for cargo clippy
if [ ! -z "$CLP" ]; then
cargo clippy "$@" -- -D warnings
fi
# if DOC is set, run cargo doc after cargo build
if [ ! -z "$DOC" ]; then
RUSTDOCFLAGS="--enable-index-page -Zunstable-options" RUSTC="${RUSTC}" cargo doc "$@"
fi