Allow linking to shared zlib

If compiled as shared library zlib produces `zlib1.dll` and `zdll.lib`.
This commit is contained in:
Pietro F. Fontana 2024-11-01 15:42:08 +01:00 committed by GitHub
parent 16372dd951
commit aae90c3c01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -690,6 +690,8 @@ class pil_build_ext(build_ext):
feature.set("zlib", "z") feature.set("zlib", "z")
elif sys.platform == "win32" and _find_library_file(self, "zlib"): elif sys.platform == "win32" and _find_library_file(self, "zlib"):
feature.set("zlib", "zlib") # alternative name 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"): if feature.want("jpeg"):
_dbg("Looking for jpeg") _dbg("Looking for jpeg")