Pass cargo subcommand to build scripts #9394
Labels
A-build-scripts
Area: build.rs scripts
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Describe the problem you are trying to solve
I'd like to have build scripts behave differently for different subcommands. For example, I'm using an external tool BNFC to generate a parser, and it has the ability to also generate a nice PDF describing the language, I'd like to generate that PDF only when running
cargo doc
.Also would be nice to be able to distinguish
cargo build
andcargo build --tests
Describe the solution you'd like
Some env var passed from cargo to the build script.
The text was updated successfully, but these errors were encountered: