From aae90c3c016ee36b838d1ca5d522301d98731261 Mon Sep 17 00:00:00 2001 From: "Pietro F. Fontana" Date: Fri, 1 Nov 2024 15:42:08 +0100 Subject: [PATCH 1/2] Allow linking to shared zlib If compiled as shared library zlib produces `zlib1.dll` and `zdll.lib`. --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index def341784..48863c397 100644 --- a/setup.py +++ b/setup.py @@ -690,6 +690,8 @@ class pil_build_ext(build_ext): feature.set("zlib", "z") elif sys.platform == "win32" and _find_library_file(self, "zlib"): feature.set("zlib", "zlib") # alternative name + elif sys.platform == "win32" and _find_library_file(self, "zdll"): + feature.set("zlib", "zdll") # different name if shared if feature.want("jpeg"): _dbg("Looking for jpeg") From a1d862f1d67e621213e0239d3e45838abeab363e Mon Sep 17 00:00:00 2001 From: "Pietro F. Fontana" Date: Tue, 5 Nov 2024 15:39:03 +0100 Subject: [PATCH 2/2] Be more specific in comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondrej Baranovič --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 48863c397..68252f3a9 100644 --- a/setup.py +++ b/setup.py @@ -691,7 +691,7 @@ class pil_build_ext(build_ext): elif sys.platform == "win32" and _find_library_file(self, "zlib"): feature.set("zlib", "zlib") # alternative name elif sys.platform == "win32" and _find_library_file(self, "zdll"): - feature.set("zlib", "zdll") # different name if shared + feature.set("zlib", "zdll") # dll import library if feature.want("jpeg"): _dbg("Looking for jpeg")