Skip to content

Commit

Permalink
Relax system version requirement (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger authored Sep 9, 2024
1 parent 7963c3c commit 2cd748f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions blosc2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ use std::path::Path;
#[cfg(feature = "regenerate-bindings")]
use std::path::PathBuf;

#[cfg(feature = "use-system-blosc2")]
const VENDORED_BLOSC2_VERSION: &'static str = "2.14.3";

fn main() {
println!("cargo::rerun-if-changed=build.rs");

Expand Down Expand Up @@ -81,13 +84,16 @@ fn main() {
// Fall back to try and locate w/ pkg-config
// TODO: 3rd option, just assume it's discoverable in the current environment?
Err(_) => {
let lib = pkg_config::Config::new()
.exactly_version("2.14.3")
.probe("blosc2")
.unwrap();
let lib = pkg_config::Config::new().probe("blosc2").unwrap();
for linkpath in lib.link_paths {
println!("cargo:rustc-link-search={}", linkpath.display());
}
if &lib.version != VENDORED_BLOSC2_VERSION {
println!(
r#"cargo::warning=blosc2 system version {} does not match vendored version {}, this is might be okay; if you experience problems check against vendored version."#,
&lib.version, VENDORED_BLOSC2_VERSION
)
}
}
}
}
Expand Down

0 comments on commit 2cd748f

Please sign in to comment.