summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorThomas Madlener <thomas.madlener@desy.de>2024-11-06 11:42:34 +0100
committerGitHub <noreply@github.com>2024-11-06 03:42:34 -0700
commit2aa5a1643321d57326540e548d98b790d375b47d (patch)
tree0c8416304a9561ddeb30a26eea9ce31bd3b88639 /var
parent0c164d274067f0500c0edd37a4e9bec18374d2bf (diff)
downloadspack-2aa5a1643321d57326540e548d98b790d375b47d.tar.gz
spack-2aa5a1643321d57326540e548d98b790d375b47d.tar.bz2
spack-2aa5a1643321d57326540e548d98b790d375b47d.tar.xz
spack-2aa5a1643321d57326540e548d98b790d375b47d.zip
edm4hep: Add json variant for newer versions (#47180)
* edm4hep: Add json variant for newer versions Explicit option has been added to EDM4hep so we now expose it via a variant as well. We keep the old behavior where we unconditionally depended on nlohmann-json and implicitly built JSON support if we could detect it cmake stage * Fix condition statement in when clause * Use open version range to avoid fixing to single version --------- Co-authored-by: Valentin Volkl <valentin.volkl@cern.ch>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/edm4hep/package.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/edm4hep/package.py b/var/spack/repos/builtin/packages/edm4hep/package.py
index 838c11b101..97c32283b0 100644
--- a/var/spack/repos/builtin/packages/edm4hep/package.py
+++ b/var/spack/repos/builtin/packages/edm4hep/package.py
@@ -61,12 +61,20 @@ class Edm4hep(CMakePackage):
description="Use the specified C++ standard when building.",
)
+ variant(
+ "json",
+ default=True,
+ description="Build edm4hep with JSON support and edm4hep2json",
+ when="@0.99.2:",
+ )
+
depends_on("cmake@3.3:", type="build")
depends_on("cmake@3.23:", type="build", when="@0.10.3:")
depends_on("python", type="build")
depends_on("root@6.08:")
- depends_on("nlohmann-json@3.10.5:")
+ depends_on("nlohmann-json@3.10.5:", when="@0.99.2: +json")
+ depends_on("nlohmann-json@3.10.5:", when="@:0.99.1")
depends_on("podio@1:", when="@0.99:")
depends_on("podio@0.15:", when="@:0.10.5")
for _std in _cxxstd_values:
@@ -88,6 +96,8 @@ class Edm4hep(CMakePackage):
# C++ Standard
args.append(self.define("CMAKE_CXX_STANDARD", self.spec.variants["cxxstd"].value))
args.append(self.define("BUILD_TESTING", self.run_tests))
+ if self.spec.satisfies("@0.99.2: +json"):
+ args.append(self.define_from_variant("EDM4HEP_WITH_JSON", "json"))
return args
def setup_run_environment(self, env):