From 8e948c03fc31f6679a45624e4541d32684f8e485 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 5 May 2025 03:28:00 -0500 Subject: [PATCH] whizard: use C++ standard of ROOT if dependency (#50255) --- var/spack/repos/builtin/packages/whizard/package.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/var/spack/repos/builtin/packages/whizard/package.py b/var/spack/repos/builtin/packages/whizard/package.py index 003ae099ee5..a0f21ae3652 100644 --- a/var/spack/repos/builtin/packages/whizard/package.py +++ b/var/spack/repos/builtin/packages/whizard/package.py @@ -117,6 +117,13 @@ class Whizard(AutotoolsPackage): msg="The fortran compiler needs to support Fortran 2008. For more detailed information see https://whizard.hepforge.org/compilers.html", ) + def flag_handler(self, name, flags): + if name == "cxxflags": + # Whizard can indirectly depend on ROOT, and must use its C++ standard + if self.spec.satisfies("^root"): + flags.extend(["-std=c++" + self.spec["root"].variants["cxxstd"].value]) + return (flags, None, None) + def setup_build_environment(self, env: EnvironmentModifications) -> None: # whizard uses some environment variables to detect dependencies at # configure time if they are not installed to standard system prefixes