diff --git a/Cargo.toml b/Cargo.toml index e6fbdaa..699ac1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ use-bindgen = ["bindgen"] [build-dependencies] bindgen = { version = "0.63.0", optional = true } +pkg-config = "0.3.15" [package.metadata.release] diff --git a/build.rs b/build.rs index 5513de4..97988b5 100644 --- a/build.rs +++ b/build.rs @@ -2,11 +2,18 @@ use std::env; #[cfg(feature = "use-bindgen")] use std::path::PathBuf; +use std::process; fn main() { // Tell cargo to tell rustc to link the system heif // shared library. - println!("cargo:rustc-link-lib=heif"); + if let Err(err) = pkg_config::Config::new() + .atleast_version("1.14") + .probe("libheif") + { + println!("cargo:warning={}", err); + process::exit(1); + } #[cfg(feature = "use-bindgen")] {