Skip to content

Commit

Permalink
Try system dylib when compiling for Apple platforms
Browse files Browse the repository at this point in the history
Fixes #84
  • Loading branch information
kornelski committed Dec 5, 2021
1 parent 6b12e9a commit 09b31b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,15 @@ fn main() {
// MSVC basically never has it preinstalled, MinGW picks up a bunch of weird
// paths we don't like, `want_static` may force us, and cross compiling almost
// never has a prebuilt version.
//
// Apple platforms have libz.1.dylib, and it's usually available even when
// cross compiling (via fat binary or in the target's Xcode SDK)
let cross_compiling = target != host;
let apple_to_apple = host.contains("-apple-") && target.contains("-apple-");
if target.contains("msvc")
|| target.contains("pc-windows-gnu")
|| want_static
|| target != host
|| (cross_compiling && !apple_to_apple)
{
return build_zlib(&mut cfg, &target);
}
Expand Down

0 comments on commit 09b31b3

Please sign in to comment.