diff options
author | Adam Lyon <lyon@fnal.gov> | 2016-02-08 02:34:24 -0600 |
---|---|---|
committer | Patrick Gartung <gartung@fnal.gov> | 2016-04-19 16:52:08 -0500 |
commit | e92da6a6ba02bdc3c879f9df8be6ee4aac2583d3 (patch) | |
tree | a385837ce2ebe1d837dd97dc6dc0e4a8a490f7f8 /lib | |
parent | dd84a575807636159d80809f59962cf799b83fd7 (diff) | |
download | spack-e92da6a6ba02bdc3c879f9df8be6ee4aac2583d3.tar.gz spack-e92da6a6ba02bdc3c879f9df8be6ee4aac2583d3.tar.bz2 spack-e92da6a6ba02bdc3c879f9df8be6ee4aac2583d3.tar.xz spack-e92da6a6ba02bdc3c879f9df8be6ee4aac2583d3.zip |
Handle c++11 and c++14 correctly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/compiler.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/compilers/gcc.py | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index d38c0b00b1..20896f9eec 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -97,6 +97,9 @@ class Compiler(object): # argument used to get C++11 options cxx11_flag = "-std=c++11" + # argument used to get C++14 options + cxx14_flag = "-std=c++1y" + def __init__(self, cspec, cc, cxx, f77, fc): def check(exe): diff --git a/lib/spack/spack/compilers/gcc.py b/lib/spack/spack/compilers/gcc.py index 64214db32d..2e57e44856 100644 --- a/lib/spack/spack/compilers/gcc.py +++ b/lib/spack/spack/compilers/gcc.py @@ -54,9 +54,16 @@ class Gcc(Compiler): if self.version < ver('4.3'): tty.die("Only gcc 4.3 and above support c++11.") elif self.version < ver('4.7'): - return "-std=gnu++0x" + return "-std=c++0x" else: - return "-std=gnu++11" + return "-std=c++11" + + @property + def cxx14_flag(self): + if self.version < ver('4.8'): + tty.die("Only gcc 4.8 and above support c++14.") + else: + return "-std=c++14" @classmethod def fc_version(cls, fc): |