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

Do not check pkg-config when cross-compiling for android #199

Merged
merged 1 commit into from
Jul 27, 2024
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
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
Loading