diff --git a/gobject/meson.build b/gobject/meson.build index 4bba94c96..91823af79 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -147,7 +147,7 @@ libgobject = library('gobject-2.0', install : true, include_directories : [configinc], dependencies : [libffi_dep, libglib_dep], - c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'], + c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION', warning_sign_conversion_args], gnu_symbol_visibility : 'hidden', link_args : glib_link_flags, ) diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build index 268dd5dd9..0ae4e86ed 100644 --- a/gobject/tests/meson.build +++ b/gobject/tests/meson.build @@ -179,7 +179,7 @@ test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) test_deps = [libm, thread_dep, libglib_dep, libgobject_dep] -test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"', '-UG_DISABLE_ASSERT'] +test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"', '-UG_DISABLE_ASSERT', warning_sign_conversion_args] test_cpp_args = test_cargs foreach test_name, extra_args : gobject_tests diff --git a/meson.build b/meson.build index b11151d28..48cb6cd3c 100644 --- a/meson.build +++ b/meson.build @@ -660,6 +660,13 @@ if have_cxx add_project_arguments(cxx.get_supported_arguments(warning_cxx_args), language: 'cpp') endif +# FIXME: This is checked and implemented separately from warning_common_args for +# now because it causes so many warnings. Adding it as a variable in various +# directories allows us to gradually tighten up support for it. Eventually, the +# warning can be enabled unconditionally in warning_c_args, and this variable +# removed. See https://gitlab.gnome.org/GNOME/glib/-/issues/3405 +warning_sign_conversion_args = cc.get_supported_arguments(['-Wsign-conversion']) + # FIXME: We cannot build some of the GResource tests with -z nodelete, which # means we cannot use that flag in add_project_link_arguments(), and must add # it to the relevant targets manually. We do the same with -Bsymbolic-functions