Skip to content

Commit

Permalink
Merge pull request #199 from sagudev/patch-2
Browse files Browse the repository at this point in the history
Do not check pkg-config when cross-compiling for android
  • Loading branch information
Byron authored Jul 27, 2024
2 parents 37d0a5d + 80e5a0c commit f76b7a2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ fn main() {
return build_zlib_ng(&target, true);
}

// All android compilers should come with libz by default, so let's just use
// the one already there. Likewise, Haiku always ships with libz, so we can
// link to it even when cross-compiling.
if target.contains("android") || target.contains("haiku") {
println!("cargo:rustc-link-lib=z");
return;
}

// Don't run pkg-config if we're linking statically (we'll build below) and
// also don't run pkg-config on FreeBSD/DragonFly. That'll end up printing
// `-L /usr/lib` which wreaks havoc with linking to an OpenSSL in /usr/local/lib
Expand Down Expand Up @@ -63,14 +71,6 @@ fn main() {
}
}

// All android compilers should come with libz by default, so let's just use
// the one already there. Likewise, Haiku always ships with libz, so we can
// link to it even when cross-compiling.
if target.contains("android") || target.contains("haiku") {
println!("cargo:rustc-link-lib=z");
return;
}

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

// Situations where we build unconditionally.
Expand Down

0 comments on commit f76b7a2

Please sign in to comment.