Add pic variant for libpng (#37964)

This commit is contained in:
Alex Richert 2023-09-13 20:43:10 -04:00 committed by GitHub
parent 75e9742d71
commit af7b4c5a2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,7 @@ class Libpng(CMakePackage):
multi=True,
description="Build shared libs, static libs or both",
)
variant("pic", default=False, description="PIC")
@property
def libs(self):
@ -53,6 +54,7 @@ def cmake_args(self):
self.define("ZLIB_ROOT", self.spec["zlib-api"].prefix),
self.define("PNG_SHARED", "shared" 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"),
]
if self.spec.satisfies("platform=darwin target=aarch64:"):
args.append("-DPNG_ARM_NEON=off")