Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't let pkg-config add system lib dirs to the search path #50

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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