summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Builtin-options.md2
-rw-r--r--docs/markdown/Configuring-a-build-directory.md2
-rw-r--r--mesonbuild/compilers/c.py8
3 files changed, 9 insertions, 3 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md
index f3cbcea75..7cdf6e8d3 100644
--- a/docs/markdown/Builtin-options.md
+++ b/docs/markdown/Builtin-options.md
@@ -257,7 +257,7 @@ or compiler being used:
| ------ | ------------- | --------------- | ----------- |
| c_args | | free-form comma-separated list | C compile arguments to use |
| c_link_args | | free-form comma-separated list | C link arguments to use |
-| c_std | none | none, c89, c99, c11, c17, c18, c2x, gnu89, gnu99, gnu11, gnu17, gnu18, gnu2x | C language standard to use |
+| c_std | none | none, c89, c99, c11, c17, c18, c2x, c23, gnu89, gnu99, gnu11, gnu17, gnu18, gnu2x, gnu23 | C language standard to use |
| c_winlibs | see below | free-form comma-separated list | Standard Windows libs to link against |
| c_thread_count | 4 | integer value ≥ 0 | Number of threads to use with emcc when using threads |
| cpp_args | | free-form comma-separated list | C++ compile arguments to use |
diff --git a/docs/markdown/Configuring-a-build-directory.md b/docs/markdown/Configuring-a-build-directory.md
index 1dcef4663..db6fc03ef 100644
--- a/docs/markdown/Configuring-a-build-directory.md
+++ b/docs/markdown/Configuring-a-build-directory.md
@@ -61,7 +61,7 @@ a sample output for a simple project.
------ ------------- --------------- -----------
c_args [] Extra arguments passed to the C compiler
c_link_args [] Extra arguments passed to the C linker
- c_std c99 [none, c89, c99, c11, c17, c18, c2x, gnu89, gnu99, gnu11, gnu17, gnu18, gnu2x] C language standard to use
+ c_std c99 [none, c89, c99, c11, c17, c18, c2x, c23, gnu89, gnu99, gnu11, gnu17, gnu18, gnu2x, gnu23] C language standard to use
cpp_args [] Extra arguments passed to the C++ compiler
cpp_debugstl false [true, false] STL debug mode
cpp_link_args [] Extra arguments passed to the C++ linker
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 951ec8e38..a943552e1 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -46,7 +46,7 @@ if T.TYPE_CHECKING:
else:
CompilerMixinBase = object
-_ALL_STDS = ['c89', 'c9x', 'c90', 'c99', 'c1x', 'c11', 'c17', 'c18', 'c2x']
+_ALL_STDS = ['c89', 'c9x', 'c90', 'c99', 'c1x', 'c11', 'c17', 'c18', 'c2x', 'c23']
_ALL_STDS += [f'gnu{std[1:]}' for std in _ALL_STDS]
_ALL_STDS += ['iso9899:1990', 'iso9899:199409', 'iso9899:1999', 'iso9899:2011', 'iso9899:2017', 'iso9899:2018']
@@ -113,6 +113,7 @@ class _ClangCStds(CompilerMixinBase):
_C17_VERSION = '>=6.0.0'
_C18_VERSION = '>=8.0.0'
_C2X_VERSION = '>=9.0.0'
+ _C23_VERSION = '>=18.0.0'
def get_options(self) -> 'MutableKeyedOptionDictType':
opts = super().get_options()
@@ -125,6 +126,8 @@ class _ClangCStds(CompilerMixinBase):
stds += ['c18']
if version_compare(self.version, self._C2X_VERSION):
stds += ['c2x']
+ if version_compare(self.version, self._C23_VERSION):
+ stds += ['c23']
std_opt = opts[OptionKey('std', machine=self.for_machine, lang=self.language)]
assert isinstance(std_opt, coredata.UserStdOption), 'for mypy'
std_opt.set_versions(stds, gnu=True)
@@ -253,6 +256,7 @@ class GnuCCompiler(GnuCompiler, CCompiler):
_C18_VERSION = '>=8.0.0'
_C2X_VERSION = '>=9.0.0'
+ _C23_VERSION = '>=14.0.0'
_INVALID_PCH_VERSION = ">=3.4.0"
def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
@@ -280,6 +284,8 @@ class GnuCCompiler(GnuCompiler, CCompiler):
stds += ['c17', 'c18']
if version_compare(self.version, self._C2X_VERSION):
stds += ['c2x']
+ if version_compare(self.version, self._C23_VERSION):
+ stds += ['c23']
key = OptionKey('std', machine=self.for_machine, lang=self.language)
std_opt = opts[key]
assert isinstance(std_opt, coredata.UserStdOption), 'for mypy'