summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/abseil-cpp/package.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/abseil-cpp/package.py b/var/spack/repos/builtin/packages/abseil-cpp/package.py
index 0bf28861a7..f58e6af372 100644
--- a/var/spack/repos/builtin/packages/abseil-cpp/package.py
+++ b/var/spack/repos/builtin/packages/abseil-cpp/package.py
@@ -31,8 +31,14 @@ class AbseilCpp(CMakePackage):
conflicts('+shared', when='@:20190808')
+ variant('cxxstd', values=('11', '14', '17', '20'), default='11',
+ description="C++ standard used during compilation")
+
def cmake_args(self):
- args = ["-DBUILD_TESTING=OFF", "-DCMAKE_CXX_STANDARD=11"]
- args.append('-DBUILD_SHARED_LIBS:Bool={0}'.format(
- 'ON' if '+shared' in self.spec else 'OFF'))
- return args
+ shared = 'ON' if '+shared' in self.spec else 'OFF'
+ cxxstd = self.spec.variants['cxxstd'].value
+ return [
+ self.define('BUILD_TESTING', 'OFF'),
+ self.define('BUILD_SHARED_LIBS:Bool', shared),
+ self.define('CMAKE_CXX_STANDARD', cxxstd)
+ ]