aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com>2019-07-11 19:23:05 -0400
committerGitHub <noreply@github.com>2019-07-11 19:23:05 -0400
commitd5cb1c2f19d7109a8269724f19ee71273afd4493 (patch)
tree6b9931e332eda0d341b96f6eb2788a21c0973e0c /mesonbuild/compilers
parent8c6e98c8479674955fdc27e97326e39c49b4382b (diff)
parent2dc11bcb53e794dc37b71ed4e4d00b9fa27742d3 (diff)
downloadmeson-d5cb1c2f19d7109a8269724f19ee71273afd4493.zip
meson-d5cb1c2f19d7109a8269724f19ee71273afd4493.tar.gz
meson-d5cb1c2f19d7109a8269724f19ee71273afd4493.tar.bz2
Merge pull request #5560 from scivision/cstd18_bug
add clang c_std=c18 alias and cleanup logic for compiler version unit tests
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/c.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 3b58a07..fb2f8c5 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -89,13 +89,16 @@ class ClangCCompiler(ClangCompiler, CCompiler):
opts = CCompiler.get_options(self)
c_stds = ['c89', 'c99', 'c11']
g_stds = ['gnu89', 'gnu99', 'gnu11']
- if self.compiler_type is CompilerType.CLANG_OSX:
- v = '>=10.0.0'
- else:
- v = '>=7.0.0'
+ # https://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html
+ # https://en.wikipedia.org/wiki/Xcode#Latest_versions
+ v = '>=10.0.0' if self.compiler_type is CompilerType.CLANG_OSX else '>=6.0.0'
if version_compare(self.version, v):
c_stds += ['c17']
g_stds += ['gnu17']
+ v = '>=11.0.0' if self.compiler_type is CompilerType.CLANG_OSX else '>=8.0.0'
+ if version_compare(self.version, v):
+ c_stds += ['c18']
+ g_stds += ['gnu18']
opts.update({'c_std': coredata.UserComboOption('C language standard to use',
['none'] + c_stds + g_stds,
'none')})