Add C++17 flags to GCC and Clang.

pull/2744/head
Jussi Pakkanen 7 years ago
parent de99b9d5b9
commit c2d23dd678
  1. 8
      mesonbuild/compilers/cpp.py
  2. 4
      run_unittests.py

@ -76,8 +76,8 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler):
def get_options(self):
return {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++1z',
'gnu++11', 'gnu++14', 'gnu++1z'],
['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z',
'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z'],
'none')}
def get_option_compile_args(self, options):
@ -102,8 +102,8 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
def get_options(self):
opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++1z',
'gnu++03', 'gnu++11', 'gnu++14', 'gnu++1z'],
['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z',
'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z'],
'none'),
'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl',
'STL debug mode',

@ -35,7 +35,7 @@ import mesonbuild.mesonlib
import mesonbuild.coredata
from mesonbuild.interpreter import ObjectHolder
from mesonbuild.mesonlib import is_linux, is_windows, is_osx, is_cygwin, windows_proof_rmtree
from mesonbuild.mesonlib import python_command, meson_command
from mesonbuild.mesonlib import python_command, meson_command, version_compare
from mesonbuild.environment import Environment
from mesonbuild.dependencies import DependencyException
from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram
@ -2048,6 +2048,8 @@ class LinuxlikeTests(BasePlatformTests):
# Check that all the listed -std=xxx options for this compiler work
# just fine when used
for v in compiler.get_options()[lang_std].choices:
if compiler.get_id() == 'clang' and version_compare(compiler.version, '<5.0.0') and '17' in v:
continue
std_opt = '{}={}'.format(lang_std, v)
self.init(testdir, ['-D' + std_opt])
cmd = self.get_compdb()[0]['command']

Loading…
Cancel
Save