fix: try export env
This commit is contained in:
14
build.rs
14
build.rs
@ -4,15 +4,13 @@ fn main() {
|
||||
// re-export ffmpeg-sys-the-third features
|
||||
// https://github.com/FFmpeg/FFmpeg/blob/master/doc/APIchanges
|
||||
for (name, _value) in env::vars() {
|
||||
if name.starts_with("DEP_FFMPEG_CHECK_") {
|
||||
if name.starts_with("DEP_FFMPEG_") && !name.starts_with("DEP_FFMPEG_CHECK_") {
|
||||
let feature_name = name["DEP_FFMPEG_".len()..name.len()].to_lowercase();
|
||||
println!(r#"cargo::rustc-check-cfg=cfg(feature, values("{feature_name}"))"#);
|
||||
println!(r#"cargo::rustc-cfg=feature="{feature_name}""#);
|
||||
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()
|
||||
r#"cargo::rustc-env=DEP_FFMPEG_{}=1"#,
|
||||
feature_name.to_uppercase()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user