From 8417c1a20fdd74bf2cc7d15f4bc52460b02d3ce4 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 9 Aug 2018 10:04:57 -0700 Subject: [PATCH 1/3] Add support for c++2a and gnu++2a --- mesonbuild/compilers/cpp.py | 8 ++++---- run_unittests.py | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 73441144e..2280f46bd 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -80,8 +80,8 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler): def get_options(self): opts = CPPCompiler.get_options(self) opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', - ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', - 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z'], + ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', + 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], 'none')}) return opts @@ -139,8 +139,8 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): def get_options(self): opts = CPPCompiler.get_options(self) opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', - ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', - 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z'], + ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', + 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], 'none'), 'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl', 'STL debug mode', diff --git a/run_unittests.py b/run_unittests.py index e0f2fe5d6..8e3da7d57 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3113,6 +3113,10 @@ class LinuxlikeTests(BasePlatformTests): (version_compare(compiler.version, '<5.0.0') or (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.2')))): continue + if (compiler.get_id() == 'clang' and '2a' in v and + (version_compare(compiler.version, '<6.0.0') or + (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.2')))): + continue std_opt = '{}={}'.format(lang_std, v) self.init(testdir, ['-D' + std_opt]) cmd = self.get_compdb()[0]['command'] From 695b325142ec84ab7e379abf5ff88df3162bb197 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 9 Aug 2018 11:50:06 -0700 Subject: [PATCH 2/3] Don't test for c++2a on gcc versions that don't support it --- run_unittests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run_unittests.py b/run_unittests.py index 8e3da7d57..9b3ddb135 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3117,6 +3117,8 @@ class LinuxlikeTests(BasePlatformTests): (version_compare(compiler.version, '<6.0.0') or (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.2')))): continue + if (compiler.get_id() == 'gcc' and '2a' in v and version_compare(compiler.version, '<8.0.0')): + continue std_opt = '{}={}'.format(lang_std, v) self.init(testdir, ['-D' + std_opt]) cmd = self.get_compdb()[0]['command'] From b665db8bb89fd6c4f89f79686afde159e6ccd333 Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 9 Aug 2018 12:42:34 -0700 Subject: [PATCH 3/3] Try appleclang 9.1 for both c++17 and c++2a --- run_unittests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_unittests.py b/run_unittests.py index 9b3ddb135..b537c32de 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3111,11 +3111,11 @@ class LinuxlikeTests(BasePlatformTests): for v in compiler.get_options()[lang_std].choices: if (compiler.get_id() == 'clang' and '17' in v and (version_compare(compiler.version, '<5.0.0') or - (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.2')))): + (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.1')))): continue if (compiler.get_id() == 'clang' and '2a' in v and (version_compare(compiler.version, '<6.0.0') or - (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.2')))): + (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.1')))): continue if (compiler.get_id() == 'gcc' and '2a' in v and version_compare(compiler.version, '<8.0.0')): continue