mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
Only call pkg_config if the feature is enabled (#66)
This commit is contained in:
committed by
Till Höppner
parent
0be10ddd49
commit
8c9cd56556
+19
-29
@@ -515,40 +515,30 @@ fn main() {
|
||||
}
|
||||
// Fallback to pkg-config
|
||||
else {
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe("libavformat")
|
||||
.unwrap();
|
||||
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe("libavfilter")
|
||||
.unwrap();
|
||||
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe("libavdevice")
|
||||
.unwrap();
|
||||
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe("libavresample")
|
||||
.unwrap();
|
||||
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe("libavutil")
|
||||
.unwrap();
|
||||
.unwrap()
|
||||
.include_paths;
|
||||
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe("libswscale")
|
||||
.unwrap();
|
||||
let libs = vec![
|
||||
("libavformat", "AVFORMAT"),
|
||||
("libavfilter", "AVFILTER"),
|
||||
("libavdevice", "AVDEVICE"),
|
||||
("libavresample", "AVRESAMPLE"),
|
||||
("libswscale", "SWSCALE"),
|
||||
("libswresample", "SWRESAMPLE"),
|
||||
];
|
||||
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe("libswresample")
|
||||
.unwrap();
|
||||
for (lib_name, env_variable_name) in libs.iter() {
|
||||
if env::var(format!("CARGO_FEATURE_{}", env_variable_name)).is_ok() {
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
.probe(lib_name)
|
||||
.unwrap()
|
||||
.include_paths;
|
||||
}
|
||||
};
|
||||
|
||||
pkg_config::Config::new()
|
||||
.statik(statik)
|
||||
|
||||
Reference in New Issue
Block a user