Say we have a project called test
. test
has a codebase with a large amount of conditional compilation in it. I need to build multiple versions of test - each one with a different output name, and different cfg
options enabled.
Currently, I can almost get what I want with the following snippet for a Cargo.toml
:
[[bin]]
name = "run"
path = "src/main.rs"
[[bin]]
name = "run_d"
path = "src/main.rs"
However, both of the output binaries are identical. What I need is some way to specify different cfg arguments for each build - like the --cfg my_custom_val
argument to rustc
.
Is this possible? And if so, how?
Disclaimer: quite new to rust, it's highly likely I overlooked something - not used to rust/cargo's build system.