Commit d572414c authored by rzumer's avatar rzumer Committed by Thomas Daede
Browse files

Restore pkg-config dependency for non-MSVC Windows targets

parent 954a81df
......@@ -23,9 +23,9 @@ backtrace = "0.3"
[build-dependencies]
cmake = "0.1.32"
pkg-config = "0.3.12"
[target.'cfg(unix)'.build-dependencies]
pkg-config = "0.3.12"
bindgen = { version = "0.37", optional = true }
[dev-dependencies]
......
// build.rs
extern crate cmake;
#[cfg(unix)]
extern crate pkg_config;
#[cfg(unix)]
#[cfg(feature = "decode_test")]
......@@ -39,13 +38,18 @@ fn main() {
let _ = fs::remove_file(dst.join("build/CMakeCache.txt"));
#[cfg(windows)] {
let bin_dir = if debug {
"Debug"
} else {
"Release"
};
println!("cargo:rustc-link-search=native={}", dst.join("build").join(bin_dir).to_str().unwrap());
println!("cargo:rustc-link-lib=static=aom");
if dst.join("lib/pkgconfig").join("aom.pc").exists() {
env::set_var("PKG_CONFIG_PATH", dst.join("lib/pkgconfig"));
pkg_config::Config::new().statik(true).probe("aom").unwrap();
} else { // MSVC
let bin_dir = if debug {
"Debug"
} else {
"Release"
};
println!("cargo:rustc-link-search=native={}", dst.join("build").join(bin_dir).to_str().unwrap());
println!("cargo:rustc-link-lib=static=aom");
}
}
#[cfg(unix)] {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment