Skip to content

Commit

Permalink
Merge pull request #50 from rinon/no_system_libdirs
Browse files Browse the repository at this point in the history
Don't let pkg-config add system lib dirs to the search path
  • Loading branch information
joshtriplett authored Jul 1, 2020
2 parents 5419322 + c9cedec commit f7aec58
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,18 @@ fn main() {
!target.contains("msvc") && // pkg-config just never works here
!(host_and_target_contain("apple") ||
host_and_target_contain("freebsd") ||
host_and_target_contain("dragonfly")) &&
pkg_config::Config::new().cargo_metadata(true).probe("zlib").is_ok() {
return
host_and_target_contain("dragonfly"))
{
// Don't print system lib dirs to cargo since this interferes with other
// packages adding non-system search paths to link against libraries
// that are also found in a system-wide lib dir.
let zlib = pkg_config::Config::new()
.cargo_metadata(true)
.print_system_libs(false)
.probe("zlib");
if zlib.is_ok() {
return;
}
}

if target.contains("msvc") {
Expand Down

0 comments on commit f7aec58

Please sign in to comment.