From 71cc47b859f2f472645eb3e11f316b29c22c6709 Mon Sep 17 00:00:00 2001 From: Alistair Buxton Date: Sat, 10 Aug 2024 15:54:23 +0000 Subject: [PATCH] Fix Meson version required for C23 support Attempting to build with Meson 1.3.2 (current version in Ubuntu 24.04 LTS) gives the following error: meson.build:1:0: ERROR: Unknown C std ['c23']. This is because C23 support was not added until Meson 1.4.0. See: https://github.com/mesonbuild/meson/blob/1.3.2/mesonbuild/compilers/c.py#L59 https://github.com/mesonbuild/meson/blob/1.4.0/mesonbuild/compilers/c.py#L49 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 956936d76..fcc562c87 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( license: 'MIT', meson_version: '>=1.3', default_options: [ - 'c_std=' + (meson.version().version_compare('>=1.3.0') ? 'c23,c11' : 'c11'), + 'c_std=' + (meson.version().version_compare('>=1.4.0') ? 'c23,c11' : 'c11'), 'warning_level=2', 'werror=true', ],