[features]
default = ["runtime_completion_gen", "comptime_completion_gen", "comptime_manpage_gen"]
runtime_completion_gen = ["dep:clap_complete",]
comptime_completion_gen = ["dep:clap_complete"]
comptime_manpage_gen = ["dep:clap_mangen"]
[dependencies]
anyhow = "1.0.0"
clap = { version = "4.0.0", features = ["derive", "help"] }
clap_complete = { version = "4.0.0", optional = true }
ignore = "0.4.25"
[build-dependencies]
clap = { version = "4.0.0", features = ["derive"] }
clap_complete = { version = "4.0.0", optional = true }
clap_mangen = { version = "0.2.31", optional = true }
The features that start with comptime, as their name suggest, happen at comp time in build.rs, they generate shell completions and manpages for my cli utility, thus they depend only at build time to their respective dependencies, but there seems no way to specify this.
Does anyone know if there is a way to specify build deps for a feature?


I don’t understand the problem.
// build.rs fn main() { #[cfg(feature = "opt_dep_b_ft")] println!("cargo:warning={}", opt_dep::NAME); #[cfg(not(feature = "opt_dep_b_ft"))] println!("cargo:warning=none"); }// src/main.rs fn main() { #[cfg(feature = "opt_dep_r_ft")] println!("Hello with {}", opt_dep::NAME); #[cfg(not(feature = "opt_dep_r_ft"))] println!("Hello with none"); }