summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/cppunit/package.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cppunit/package.py b/var/spack/repos/builtin/packages/cppunit/package.py
index a7edc3a6f6..87bf15121a 100644
--- a/var/spack/repos/builtin/packages/cppunit/package.py
+++ b/var/spack/repos/builtin/packages/cppunit/package.py
@@ -13,3 +13,15 @@ class Cppunit(AutotoolsPackage):
url = "http://dev-www.libreoffice.org/src/cppunit-1.13.2.tar.gz"
version('1.13.2', '0eaf8bb1dcf4d16b12bec30d0732370390d35e6f')
+
+ variant('cxxstd',
+ default='default',
+ values=('default', '98', '11', '14', '17'),
+ multi=False,
+ description='Use the specified C++ standard when building.')
+
+ def setup_environment(self, spack_env, run_env):
+ cxxstd = self.spec.variants['cxxstd'].value
+ cxxstdflag = '' if cxxstd == 'default' else \
+ getattr(self.compiler, 'cxx{0}_flag'.format(cxxstd))
+ spack_env.append_flags('CXXFLAGS', cxxstdflag)