diff options
author | Nic McDonald <nicmcd@users.noreply.github.com> | 2021-07-09 02:54:14 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-09 10:54:14 +0200 |
commit | 4c3005673e526aa6f8da25ee74a8ea229facd3a3 (patch) | |
tree | b87f65994b5fbe1b2d75043b6a8d36457374aa1f /var | |
parent | 89b57929f2f999b2f9d7628b4fdfae3d3bfd6122 (diff) | |
download | spack-4c3005673e526aa6f8da25ee74a8ea229facd3a3.tar.gz spack-4c3005673e526aa6f8da25ee74a8ea229facd3a3.tar.bz2 spack-4c3005673e526aa6f8da25ee74a8ea229facd3a3.tar.xz spack-4c3005673e526aa6f8da25ee74a8ea229facd3a3.zip |
abseil-cpp: add cxxstd variant (#24577)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/abseil-cpp/package.py | 14 |
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) + ] |