From 23009aadc68273b080a57cdf70cd85aeecde6144 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 25 Sep 2024 07:17:18 -0700 Subject: [PATCH] build: switch back to c_std=gnu99 pending ObjC fix It's better to warn by default on MSVC (which we were already doing before we bumped to 1.4.0) than to fail by default on macOS. Fixes: 51e3e7d9ae ("build: Bump Meson dependency to 1.4.0") --- .gitlab-ci.yml | 12 ++++++------ .gitlab-ci/test-msvc.bat | 1 - meson.build | 6 +++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c43b5b82a..1199ce55d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -590,7 +590,9 @@ vs2017-x64: script: # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines # aren’t currently set up for that. - - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} + # FIXME: Use --meson-fatal-warnings once we've enabled c_std=gnu99,c99 + # for the runner's Meson version. + - .gitlab-ci/test-msvc.bat --buildtype debug --wrap-mode=default --python.platlibdir=C:\Python37\site-packages --python.purelibdir=C:\Python37\site-packages @@ -623,7 +625,9 @@ vs2017-x64-static: script: # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines # aren’t currently set up for that. - - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} + # FIXME: Use --meson-fatal-warnings once we've enabled c_std=gnu99,c99 + # for the runner's Meson version. + - .gitlab-ci/test-msvc.bat --buildtype debug --wrap-mode=default --default-library=static --python.platlibdir=C:\Python37\site-packages @@ -721,12 +725,8 @@ macos-arm64: # isn't currently set up for that. See: # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388 # - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225 - - # FIXME: Override c_std to not be a list, until - # https://github.com/mesonbuild/meson/issues/13639 is fixed. - meson setup ${MESON_COMMON_OPTIONS} --wrap-mode=default - -Dc_std=gnu99 --werror _build - meson compile -C _build diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index f96edb077..c6361ce0f 100644 --- a/.gitlab-ci/test-msvc.bat +++ b/.gitlab-ci/test-msvc.bat @@ -11,7 +11,6 @@ for %%x in (%*) do ( ) set args=%args:~1% -:: FIXME: make warnings fatal pip3 install --upgrade --user meson==1.4.2 || goto :error meson setup %args% _build || goto :error meson compile -C _build || goto :error diff --git a/meson.build b/meson.build index 1f1243e56..5f7870d1f 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,11 @@ project('glib', 'c', default_options : [ 'buildtype=debugoptimized', 'warning_level=3', - 'c_std=gnu99,c99' + # FIXME: After https://github.com/mesonbuild/meson/issues/13639 is + # fixed, change this to + # meson.version().version_compare('>=FIXED_MESON_VERSION') ? 'c_std=gnu99,c99' : 'c_std=gnu99' + # to avoid a warning on MSVC. + 'c_std=gnu99' ] )