Support build.rs cargo:rustc-cfg

This commit is contained in:
robojumper 2020-05-04 13:29:09 +02:00
parent 6a48a94d47
commit 2980ba1fde
4 changed files with 158 additions and 3 deletions

View file

@ -399,6 +399,13 @@ impl ProjectWorkspace {
let cfg_options = {
let mut opts = default_cfg_options.clone();
opts.insert_features(cargo[pkg].features.iter().map(Into::into));
opts.insert_cfgs(
cargo[pkg]
.cfgs
.iter()
.filter_map(|c| c.to_str())
.map(Into::into),
);
opts
};
let mut env = Env::default();