diff options
author | Ben Morgan <drbenmorgan@users.noreply.github.com> | 2019-02-14 05:05:39 +0000 |
---|---|---|
committer | Patrick Gartung <gartung@fnal.gov> | 2019-02-13 23:05:39 -0600 |
commit | 7e8b8d61a14f9b62a7024eed198d869b3f9f93c7 (patch) | |
tree | fc85facba68a03e1af947ba8e058894b5e798671 | |
parent | 6e95e06bdae08801f1ed586cf1d0dc6f5717be2c (diff) | |
download | spack-7e8b8d61a14f9b62a7024eed198d869b3f9f93c7.tar.gz spack-7e8b8d61a14f9b62a7024eed198d869b3f9f93c7.tar.bz2 spack-7e8b8d61a14f9b62a7024eed198d869b3f9f93c7.tar.xz spack-7e8b8d61a14f9b62a7024eed198d869b3f9f93c7.zip |
icu4c: Add cxxstd variant (#10552)
* icu4c: Add cxxstd variant
For versions supported in Spack, ICU4C defaults to the C++11.
Provide a variant to default to this, plus options for C++14
and 17 if dependees require for ABI compatibility.
* icu4c: cxxstd variant cannot be multi
-rw-r--r-- | var/spack/repos/builtin/packages/icu4c/package.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/icu4c/package.py b/var/spack/repos/builtin/packages/icu4c/package.py index 29661177f4..4b9474e2a1 100644 --- a/var/spack/repos/builtin/packages/icu4c/package.py +++ b/var/spack/repos/builtin/packages/icu4c/package.py @@ -20,12 +20,27 @@ class Icu4c(AutotoolsPackage): version('58.2', 'fac212b32b7ec7ab007a12dff1f3aea1') version('57.1', '976734806026a4ef8bdd17937c8898b9') + variant('cxxstd', + default='11', + values=('11', '14', '17'), + multi=False, + description='Use the specified C++ standard when building') + configure_directory = 'source' def url_for_version(self, version): url = "http://download.icu-project.org/files/icu4c/{0}/icu4c-{1}-src.tgz" return url.format(version.dotted, version.underscored) + def flag_handler(self, name, flags): + if name == 'cxxflags': + # Control of the C++ Standard is via adding the required "-std" + # flag to CXXFLAGS in env + flags.append(getattr(self.compiler, + 'cxx{0}_flag'.format( + self.spec.variants['cxxstd'].value))) + return (None, flags, None) + def configure_args(self): args = [] |