libpng package: find correct zlib library on Windows (#49034)
This explicitly specifies the correct library for zlib to CMake: CMake's find zlib looks for zlib before zdll. On Windows, zlib is the static lib, and zdll the import library. LibPNG only links to shared zlib, but was getting zlib from CMake on Windows, which was resulting in a linker failure.
This commit is contained in:
parent
924204828e
commit
f8524f9d5e
@ -62,6 +62,9 @@ def cmake_args(self):
|
|||||||
self.define("PNG_STATIC", "static" in self.spec.variants["libs"].value),
|
self.define("PNG_STATIC", "static" in self.spec.variants["libs"].value),
|
||||||
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
|
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
|
||||||
]
|
]
|
||||||
|
zlib_lib = self.spec["zlib-api"].libs
|
||||||
|
if zlib_lib:
|
||||||
|
args.append(self.define("ZLIB_LIBRARY", zlib_lib[0]))
|
||||||
if self.spec.satisfies("platform=darwin target=aarch64:"):
|
if self.spec.satisfies("platform=darwin target=aarch64:"):
|
||||||
args.append("-DPNG_ARM_NEON=off")
|
args.append("-DPNG_ARM_NEON=off")
|
||||||
return args
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user