lz4: fix bug on darwin, use makefile by default (#36820)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
parent
0c2aafec33
commit
92144d6375
@ -31,7 +31,7 @@ class Lz4(CMakePackage, MakefilePackage):
|
|||||||
|
|
||||||
depends_on("valgrind", type="test")
|
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
|
parallel = False if sys.platform == "win32" else True
|
||||||
variant(
|
variant(
|
||||||
"libs",
|
"libs",
|
||||||
@ -56,11 +56,6 @@ def patch(self):
|
|||||||
filter_file("-fvisibility=hidden", "", "lib/Makefile")
|
filter_file("-fvisibility=hidden", "", "lib/Makefile")
|
||||||
filter_file("-pedantic", "", "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):
|
class CMakeBuilder(CMakeBuilder):
|
||||||
@property
|
@property
|
||||||
@ -68,7 +63,7 @@ def root_cmakelists_dir(self):
|
|||||||
return os.path.join(super().root_cmakelists_dir, "build", "cmake")
|
return os.path.join(super().root_cmakelists_dir, "build", "cmake")
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
args = []
|
args = [self.define("CMAKE_POLICY_DEFAULT_CMP0042", "NEW")]
|
||||||
# # no pic on windows
|
# # no pic on windows
|
||||||
if "platform=windows" in self.spec:
|
if "platform=windows" in self.spec:
|
||||||
args.append(self.define("LZ4_POSITION_INDEPENDENT_LIB", False))
|
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_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"),
|
"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)
|
||||||
|
Loading…
Reference in New Issue
Block a user