Skip to content

Commit 923d0bb

Browse files
committed
Try system dylib when compiling for Apple platforms
Fixes #84
1 parent 6b12e9a commit 923d0bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ fn main() {
6767
// MSVC basically never has it preinstalled, MinGW picks up a bunch of weird
6868
// paths we don't like, `want_static` may force us, and cross compiling almost
6969
// never has a prebuilt version.
70+
//
71+
// Apple platforms have libz.1.dylib, and it's usually available even when
72+
// cross compiling (via fat binary or in the target's Xcode SDK)
7073
if target.contains("msvc")
7174
|| target.contains("pc-windows-gnu")
7275
|| want_static
73-
|| target != host
76+
|| (target != host && !target.contains("-apple-"))
7477
{
7578
return build_zlib(&mut cfg, &target);
7679
}

0 commit comments

Comments
 (0)