![FreezyLemon](/assets/img/avatar_default.png)
* 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.
20 lines
557 B
Rust
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()
|
|
);
|
|
}
|
|
}
|
|
}
|