aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-08-23 00:26:44 +0300
committerGitHub <noreply@github.com>2020-08-23 00:26:44 +0300
commitfc13c90de343f22f494cc1868bd76ac372236ee1 (patch)
tree9ce78640259911b2b5f420bd38552667c6ab8f74 /mesonbuild
parenta9f33d96c674763657315770a99358d271206551 (diff)
parent9f338e41b06cbdd9a61a1122932177087c49bff8 (diff)
downloadmeson-fc13c90de343f22f494cc1868bd76ac372236ee1.zip
meson-fc13c90de343f22f494cc1868bd76ac372236ee1.tar.gz
meson-fc13c90de343f22f494cc1868bd76ac372236ee1.tar.bz2
Merge pull request #7600 from alexrp/master
Add C2x option support.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/c.py15
-rw-r--r--mesonbuild/environment.py3
2 files changed, 15 insertions, 3 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 936b04c..13ca1d4 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -84,6 +84,7 @@ class ClangCCompiler(ClangCompiler, CCompiler):
_C17_VERSION = '>=6.0.0'
_C18_VERSION = '>=8.0.0'
+ _C2X_VERSION = '>=9.0.0'
def __init__(self, exelist, version, for_machine: MachineChoice,
is_cross, info: 'MachineInfo', exe_wrapper=None,
@@ -108,6 +109,9 @@ class ClangCCompiler(ClangCompiler, CCompiler):
if version_compare(self.version, self._C18_VERSION):
c_stds += ['c18']
g_stds += ['gnu18']
+ if version_compare(self.version, self._C2X_VERSION):
+ c_stds += ['c2x']
+ g_stds += ['gnu2x']
opts.update({
'std': coredata.UserComboOption(
'C language standard to use',
@@ -147,6 +151,7 @@ class AppleClangCCompiler(ClangCCompiler):
_C17_VERSION = '>=10.0.0'
_C18_VERSION = '>=11.0.0'
+ _C2X_VERSION = '>=11.0.0'
class EmscriptenCCompiler(EmscriptenMixin, LinkerEnvVarsMixin, ClangCCompiler):
@@ -195,6 +200,10 @@ class ArmclangCCompiler(ArmclangCompiler, CCompiler):
class GnuCCompiler(GnuCompiler, CCompiler):
+
+ _C18_VERSION = '>=8.0.0'
+ _C2X_VERSION = '>=9.0.0'
+
def __init__(self, exelist, version, for_machine: MachineChoice,
is_cross, info: 'MachineInfo', exe_wrapper=None,
defines=None, **kwargs):
@@ -211,10 +220,12 @@ class GnuCCompiler(GnuCompiler, CCompiler):
opts = CCompiler.get_options(self)
c_stds = ['c89', 'c99', 'c11']
g_stds = ['gnu89', 'gnu99', 'gnu11']
- v = '>=8.0.0'
- if version_compare(self.version, v):
+ if version_compare(self.version, self._C18_VERSION):
c_stds += ['c17', 'c18']
g_stds += ['gnu17', 'gnu18']
+ if version_compare(self.version, self._C2X_VERSION):
+ c_stds += ['c2x']
+ g_stds += ['gnu2x']
opts.update({
'std': coredata.UserComboOption(
'C language standard to use',
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 492789c..eee336e 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -203,6 +203,7 @@ def get_llvm_tool_names(tool: str) -> T.List[str]:
# unless it becomes a stable release.
suffixes = [
'', # base (no suffix)
+ '-10', '100',
'-9', '90',
'-8', '80',
'-7', '70',
@@ -214,7 +215,7 @@ def get_llvm_tool_names(tool: str) -> T.List[str]:
'-3.7', '37',
'-3.6', '36',
'-3.5', '35',
- '-10', # Debian development snapshot
+ '-11', # Debian development snapshot
'-devel', # FreeBSD development snapshot
]
names = []