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.
This commit is contained in:
Simon Ser 2024-01-05 11:50:02 +01:00 committed by Simon Zeni
parent 3880ee15d7
commit 85875c47d9
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ tasks:
- setup: | - setup: |
cd wlroots cd wlroots
CC=gcc meson setup build-gcc --fatal-meson-warnings --default-library=both -Dauto_features=enabled --prefix /usr -Db_sanitize=address,undefined 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: | - gcc: |
cd wlroots/build-gcc cd wlroots/build-gcc
ninja ninja

View File

@ -5,7 +5,7 @@ project(
license: 'MIT', license: 'MIT',
meson_version: '>=0.59.0', meson_version: '>=0.59.0',
default_options: [ default_options: [
'c_std=c11', 'c_std=' + (meson.version().version_compare('>=1.3.0') ? 'c23,c11' : 'c11'),
'warning_level=2', 'warning_level=2',
'werror=true', 'werror=true',
], ],