FreezyLemon 3239649dbb
Add rustc-check-cfg for ffmpeg_x_y features (#70)
* sys: Add check-cfg statements

* Add rustc-check-cfg in main crate

The sys build script sets an environment variable for every
feature that needs to be added to rustc-check-cfg.
2024-07-19 18:35:19 -04:00

20 lines
557 B
Rust

use std::env;
fn main() {
for (name, _value) in env::vars() {
println!("{name}");
if name.starts_with("DEP_FFMPEG_CHECK_") {
println!(
r#"cargo:rustc-check-cfg=cfg(feature, values("{}"))"#,
name["DEP_FFMPEG_CHECK_".len()..name.len()].to_lowercase()
);
} else if name.starts_with("DEP_FFMPEG_") {
println!(
r#"cargo:rustc-cfg=feature="{}""#,
name["DEP_FFMPEG_".len()..name.len()].to_lowercase()
);
}
}
}