Skip to content

Commit

Permalink
Use external/system libdeflate when pkgconfig can find it
Browse files Browse the repository at this point in the history
  • Loading branch information
musicinmybrain committed Jan 5, 2024
1 parent c177713 commit 2eb06b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions libdeflate-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ build = "build.rs"

[build-dependencies]
cc = "1.0"
pkg-config = "0.3.9"

[features]
freestanding = []
9 changes: 9 additions & 0 deletions libdeflate-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ use std::path::{Path, PathBuf};
fn main() {
let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());

if pkg_config::Config::new()
.print_system_libs(false)
.cargo_metadata(true)
.probe("libdeflate")
.is_ok()
{
return;
}

let mut build = cc::Build::new();

build
Expand Down

0 comments on commit 2eb06b3

Please sign in to comment.