rustbuild: Add bench subcommand

Add command `./x.py bench`; use `./x.py bench --help -v` to list all
available benchmark targets.
This commit is contained in:
Ulrik Sverdrup
2016-11-25 22:13:59 +01:00
parent 127a83df66
commit b1566baa0b
5 changed files with 88 additions and 14 deletions

View File

@@ -141,6 +141,7 @@ struct Crate {
doc_step: String,
build_step: String,
test_step: String,
bench_step: String,
}
/// The various "modes" of invoking Cargo.
@@ -457,7 +458,8 @@ impl Build {
if self.config.verbose || self.flags.verbose {
cargo.arg("-v");
}
if self.config.rust_optimize {
// FIXME: cargo bench does not accept `--release`
if self.config.rust_optimize && cmd != "bench" {
cargo.arg("--release");
}
if self.config.vendor {