Merge pull request #802 from gartung/std-cpp14
Handle c++11 and c++14 correctly
This commit is contained in:
commit
13e52962ee
@ -97,6 +97,9 @@ class Compiler(object):
|
|||||||
# argument used to get C++11 options
|
# argument used to get C++11 options
|
||||||
cxx11_flag = "-std=c++11"
|
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 __init__(self, cspec, cc, cxx, f77, fc):
|
||||||
def check(exe):
|
def check(exe):
|
||||||
|
@ -54,9 +54,16 @@ def cxx11_flag(self):
|
|||||||
if self.version < ver('4.3'):
|
if self.version < ver('4.3'):
|
||||||
tty.die("Only gcc 4.3 and above support c++11.")
|
tty.die("Only gcc 4.3 and above support c++11.")
|
||||||
elif self.version < ver('4.7'):
|
elif self.version < ver('4.7'):
|
||||||
return "-std=gnu++0x"
|
return "-std=c++0x"
|
||||||
else:
|
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
|
@classmethod
|
||||||
def fc_version(cls, fc):
|
def fc_version(cls, fc):
|
||||||
|
Loading…
Reference in New Issue
Block a user