lz4: fix bug on darwin, use makefile by default (#36820)

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
Massimiliano Culpo 2023-04-14 09:43:59 +02:00 committed by GitHub
parent 0c2aafec33
commit 92144d6375
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ class Lz4(CMakePackage, MakefilePackage):
depends_on("valgrind", type="test")
build_system("cmake", "makefile", default="cmake")
build_system("cmake", "makefile", default="makefile")
parallel = False if sys.platform == "win32" else True
variant(
"libs",
@ -56,11 +56,6 @@ def patch(self):
filter_file("-fvisibility=hidden", "", "lib/Makefile")
filter_file("-pedantic", "", "Makefile")
@run_after("install")
def darwin_fix(self):
if sys.platform == "darwin":
fix_darwin_install_name(self.prefix.lib)
class CMakeBuilder(CMakeBuilder):
@property
@ -68,7 +63,7 @@ def root_cmakelists_dir(self):
return os.path.join(super().root_cmakelists_dir, "build", "cmake")
def cmake_args(self):
args = []
args = [self.define("CMAKE_POLICY_DEFAULT_CMP0042", "NEW")]
# # no pic on windows
if "platform=windows" in self.spec:
args.append(self.define("LZ4_POSITION_INDEPENDENT_LIB", False))
@ -101,3 +96,7 @@ def install(self, pkg, spec, prefix):
"BUILD_SHARED={0}".format("yes" if "libs=shared" in self.spec else "no"),
"BUILD_STATIC={0}".format("yes" if "libs=static" in self.spec else "no"),
)
@run_after("install", when="platform=darwin")
def darwin_fix(self):
fix_darwin_install_name(self.prefix.lib)