diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-10-17 17:11:42 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-10-17 19:19:30 +0300 |
commit | 997e6ce7894ab01d2ee889a9b0a6e4954d8a21fb (patch) | |
tree | 4d66dbaa85358764064e9592710cba47b1624c96 | |
parent | 0c95d92404cfc5cebb32c886484946a8a42f6e79 (diff) | |
download | meson-fix7611.zip meson-fix7611.tar.gz meson-fix7611.tar.bz2 |
Make MSVC accept gnu11 as a language standard version. Closes: #7611.fix7611
-rw-r--r-- | mesonbuild/compilers/c.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 95c4698..8d0a52b 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -428,7 +428,11 @@ class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompi def get_options(self) -> 'OptionDictType': opts = super().get_options() - c_stds = ['none', 'c89', 'c99', 'c11'] + c_stds = ['none', 'c89', 'c99', 'c11', + # Need to have these to be compatible with projects + # that set c_std to e.g. gnu99. + # https://github.com/mesonbuild/meson/issues/7611 + 'gnu89', 'gnu90', 'gnu9x', 'gnu99', 'gnu1x', 'gnu11'] opts.update({ 'std': coredata.UserComboOption( 'C language standard to use', @@ -442,8 +446,8 @@ class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompi args = [] std = options['std'] # As of MVSC 16.7, /std:c11 is the only valid C standard option. - if std.value in {'c11'}: - args.append('/std:' + std.value) + if std.value in {'c11', 'gnu11'}: + args.append('/std:c11') return args |