muparser: refactor to use new multi-build-system logic (#44552)
This commit is contained in:
parent
e5f5749d67
commit
e092026eb8
@ -6,7 +6,7 @@
|
|||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
class Muparser(Package):
|
class Muparser(CMakePackage, Package):
|
||||||
"""C++ math expression parser library."""
|
"""C++ math expression parser library."""
|
||||||
|
|
||||||
homepage = "https://beltoforion.de/en/muparser/"
|
homepage = "https://beltoforion.de/en/muparser/"
|
||||||
@ -22,21 +22,29 @@ class Muparser(Package):
|
|||||||
# https://github.com/beltoforion/muparser/pull/46
|
# https://github.com/beltoforion/muparser/pull/46
|
||||||
patch("auto_ptr.patch", when="@2.2.5")
|
patch("auto_ptr.patch", when="@2.2.5")
|
||||||
|
|
||||||
depends_on("cmake@3.1.0:", when="@2.2.6:", type="build")
|
variant("samples", default=True, description="enable samples", when="build_system=cmake")
|
||||||
|
variant("openmp", default=True, description="enable OpenMP support", when="build_system=cmake")
|
||||||
|
variant(
|
||||||
|
"wide_char",
|
||||||
|
default=False,
|
||||||
|
description="enable wide character strings in place of ASCII",
|
||||||
|
when="build_system=cmake",
|
||||||
|
)
|
||||||
|
variant("shared", default=True, description="enable shared libs", when="build_system=cmake")
|
||||||
|
|
||||||
# Cmake build since 2.2.6
|
# Non-CMake build system is not supported by windows
|
||||||
@when("@2.2.6:")
|
conflicts("platform=windows", when="@:2.2.5")
|
||||||
def install(self, spec, prefix):
|
build_system(conditional("cmake", when="@2.2.6:"), "generic", default="cmake")
|
||||||
cmake_args = ["-DENABLE_SAMPLES=OFF", "-DENABLE_OPENMP=OFF", "-DBUILD_SHARED_LIBS=ON"]
|
|
||||||
|
|
||||||
cmake_args.extend(std_cmake_args)
|
def cmake_args(self):
|
||||||
|
return [
|
||||||
|
self.define_from_variant("ENABLE_SAMPLES", "samples"),
|
||||||
|
self.define_from_variant("ENABLE_OPENMP", "openmp"),
|
||||||
|
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
|
||||||
|
self.define_from_variant("ENABLE_WIDE_CHAR", "wide_char"),
|
||||||
|
]
|
||||||
|
|
||||||
with working_dir("spack-build", create=True):
|
@when("@:2.2.5")
|
||||||
cmake("..", *cmake_args)
|
|
||||||
make()
|
|
||||||
make("install")
|
|
||||||
|
|
||||||
@when("@2.2.5")
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
options = [
|
options = [
|
||||||
"--disable-debug",
|
"--disable-debug",
|
||||||
|
Loading…
Reference in New Issue
Block a user