zlib package: Ensure correct lib search on Windows (#48512)

* Name of zlib's library differs on Windows; also account for name
  differing when building +shared
* `zlib`'s `.libs` implementation was searching for the runtime
  libraries (the .dlls) and should be searching for link-time libs
This commit is contained in:
John W. Parent 2025-02-13 19:15:03 -05:00 committed by GitHub
parent 0eb55a0b8f
commit 12e0eb6178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,7 +84,12 @@ def determine_version(cls, lib):
@property
def libs(self):
shared = "+shared" in self.spec
return find_libraries(["libz"], root=self.prefix, recursive=True, shared=shared)
libnames = ["libz"]
if self.spec.satisfies("platform=windows"):
libnames.append("zdll" if shared else "zlib")
return find_libraries(
libnames, root=self.prefix, recursive=True, shared=shared, runtime=False
)
class SetupEnvironment: