freetype: add pic and shared variants (#37898)

This commit is contained in:
Alex Richert 2023-05-26 16:05:10 -07:00 committed by GitHub
parent d1bfcfafe3
commit b3268c2703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,11 @@ class Freetype(AutotoolsPackage, CMakePackage):
"support __builtin_shuffle)",
)
variant("shared", default=True, description="Build shared libraries")
variant("pic", default=True, description="Enable position-independent code (PIC)")
requires("+pic", when="+shared build_system=autotools")
patch("windows.patch", when="@2.9.1")
@property
@ -64,6 +69,8 @@ def configure_args(self):
]
if self.spec.satisfies("@2.9.1:"):
args.append("--enable-freetype-config")
args.extend(self.enable_or_disable("shared"))
args.extend(self.with_or_without("pic"))
return args
@ -75,4 +82,6 @@ def cmake_args(self):
self.define("FT_DISABLE_HARFBUZZ", True),
self.define("FT_REQUIRE_PNG", True),
self.define("FT_REQUIRE_BZIP2", True),
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
]