Add shared and pic variants to libtiff (#37965)

* Add static-only option for libtiff

* update libtiff to add pic variant

* fix libtiff pic setting
This commit is contained in:
Alex Richert 2023-05-27 09:24:27 -07:00 committed by GitHub
parent b3268c2703
commit fcd49f2f08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,9 @@ class Libtiff(CMakePackage, AutotoolsPackage):
build_system(conditional("cmake", when="@4.0.5:"), "autotools", default="cmake")
variant("shared", default=True, description="Build shared")
variant("pic", default=False, description="Enable position-independent code (PIC)")
with when("build_system=cmake"):
depends_on("cmake@3.9:", when="@4.3:", type="build")
depends_on("cmake@2.8.11:", when="@4.0.10:4.2", type="build")
@ -112,6 +115,8 @@ class CMakeBuilder(CMakeBuilder):
def cmake_args(self):
args = [self.define_from_variant(var) for var in VARIANTS]
args.append("-Dsphinx=OFF")
args += [self.define_from_variant("BUILD_SHARED_LIBS", "shared")]
args += [self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic")]
# Remove empty strings
args = [arg for arg in args if arg]
@ -124,6 +129,10 @@ def configure_args(self):
args = []
for var in VARIANTS:
args.extend(self.enable_or_disable(var))
args.append("--disable-sphinx")
args.extend(self.enable_or_disable("shared"))
args.extend(self.with_or_without("pic"))
return args