From c61c47faf261f2f2f7c8b8247612591fec3f9836 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 26 Jan 2024 11:11:48 +0900 Subject: [PATCH] Really try dylib when compiling for Apple platforms Really fixes #84. This is what #85 intended, as far as I can tell, but the logic was such that it didn't work for cross-compiles from e.g. Linux (apple_to_apple would be false, leading to the build_zlib path being taken) --- build.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 1368a124..13396fb2 100644 --- a/build.rs +++ b/build.rs @@ -67,11 +67,10 @@ fn main() { // 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 - || (cross_compiling && !apple_to_apple) + || (cross_compiling && !target.contains("-apple-")) { return build_zlib(&mut cfg, &target); }