Force GCC to always provide a C++14 flag (#29781)
* Force GCC to always provide a C++14 flag Updated gnu logic so that the c++14 flag for g++ is always propagated. This fixes issues with build systems that error out if passed an empty string for a flag. Engaging in the best kind of software engineering by updating the unit test to pass with the value it is now passed. This should better match the expected flag for g++ compiling with the C++14 standard
This commit is contained in:
parent
654a07d642
commit
5ab526185a
@ -78,10 +78,8 @@ def cxx14_flag(self):
|
|||||||
self, "the C++14 standard", "cxx14_flag", "< 4.8")
|
self, "the C++14 standard", "cxx14_flag", "< 4.8")
|
||||||
elif self.real_version < ver('4.9'):
|
elif self.real_version < ver('4.9'):
|
||||||
return "-std=c++1y"
|
return "-std=c++1y"
|
||||||
elif self.real_version < ver('6.0'):
|
|
||||||
return "-std=c++14"
|
|
||||||
else:
|
else:
|
||||||
return ""
|
return "-std=c++14"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cxx17_flag(self):
|
def cxx17_flag(self):
|
||||||
|
@ -501,7 +501,7 @@ def test_gcc_flags():
|
|||||||
unsupported_flag_test("cxx14_flag", "gcc@4.7")
|
unsupported_flag_test("cxx14_flag", "gcc@4.7")
|
||||||
supported_flag_test("cxx14_flag", "-std=c++1y", "gcc@4.8")
|
supported_flag_test("cxx14_flag", "-std=c++1y", "gcc@4.8")
|
||||||
supported_flag_test("cxx14_flag", "-std=c++14", "gcc@4.9")
|
supported_flag_test("cxx14_flag", "-std=c++14", "gcc@4.9")
|
||||||
supported_flag_test("cxx14_flag", "", "gcc@6.0")
|
supported_flag_test("cxx14_flag", "-std=c++14", "gcc@6.0")
|
||||||
unsupported_flag_test("cxx17_flag", "gcc@4.9")
|
unsupported_flag_test("cxx17_flag", "gcc@4.9")
|
||||||
supported_flag_test("cxx17_flag", "-std=c++1z", "gcc@5.0")
|
supported_flag_test("cxx17_flag", "-std=c++1z", "gcc@5.0")
|
||||||
supported_flag_test("cxx17_flag", "-std=c++17", "gcc@6.0")
|
supported_flag_test("cxx17_flag", "-std=c++17", "gcc@6.0")
|
||||||
|
Loading…
Reference in New Issue
Block a user