Skip to content

Commit 171509d

Browse files
committed
Add support for cargo --profile
Closes #167
1 parent c1268f9 commit 171509d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bin/cargo-flamegraph.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ struct Opt {
1212
#[clap(long)]
1313
dev: bool,
1414

15+
/// Build with the specified profile
16+
#[clap(long)]
17+
profile: Option<String>,
18+
1519
/// package with the binary to run
1620
#[clap(short, long)]
1721
package: Option<String>,
@@ -84,8 +88,10 @@ fn build(opt: &Opt, kind: impl IntoIterator<Item = String>) -> anyhow::Result<Ve
8488
cmd.arg("build");
8589
}
8690

91+
if let Some(profile) = &opt.profile {
92+
cmd.arg("--profile").arg(profile);
8793
// do not use `--release` when we are building for `bench`
88-
if !opt.dev && opt.bench.is_none() {
94+
} else if !opt.dev && opt.bench.is_none() {
8995
cmd.arg("--release");
9096
}
9197

0 commit comments

Comments
 (0)