fn emit_cfg_alias(alias: &str, features: &[&str]) {
let any_enabled = features.iter().any(|f| {
let var = format!("CARGO_FEATURE_{}", f.to_uppercase().replace('-', "_"));
std::env::var(var).is_ok()
});
if any_enabled {
println!("cargo::rustc-cfg={alias}");
}
}
fn main() {
emit_cfg_alias(
"any_raw",
&[
"arw-decode",
"cr2-decode",
"cr3-decode",
"crw-decode",
"dng-decode",
"nef-decode",
"raf-decode",
],
);
emit_cfg_alias(
"any_standard_decode",
&[
"gif-decode",
"jpeg-decode",
"png-decode",
"webp-decode",
"jxl-decode",
"tiff-decode",
"avif-decode",
"heic-decode",
"svg-decode",
"ppm-decode",
],
);
emit_cfg_alias(
"any_standard_encode",
&[
"png-encode",
"jpeg-encode",
"webp-encode",
"avif-encode",
"jxl-encode",
"dng-encode",
],
);
}