From 85875c47d9234c2ad61bf3af97fca133fe3ffa78 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 5 Jan 2024 11:50:02 +0100 Subject: [PATCH] build: build with C23 if supported This lets us conditionally leverage C23 features. Force one build to C11 in CI to make sure we stay C11-compatible. --- .builds/archlinux.yml | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml index cac8edac..c9a9faf2 100644 --- a/.builds/archlinux.yml +++ b/.builds/archlinux.yml @@ -27,7 +27,7 @@ tasks: - setup: | cd wlroots CC=gcc meson setup build-gcc --fatal-meson-warnings --default-library=both -Dauto_features=enabled --prefix /usr -Db_sanitize=address,undefined - CC=clang meson setup build-clang --fatal-meson-warnings -Dauto_features=enabled + CC=clang meson setup build-clang --fatal-meson-warnings -Dauto_features=enabled -Dc_std=c11 - gcc: | cd wlroots/build-gcc ninja diff --git a/meson.build b/meson.build index b0805b0c..80b3e243 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( license: 'MIT', meson_version: '>=0.59.0', default_options: [ - 'c_std=c11', + 'c_std=' + (meson.version().version_compare('>=1.3.0') ? 'c23,c11' : 'c11'), 'warning_level=2', 'werror=true', ],