From 41a7e8e3e0f61b06431410f8e5e2a1ed8922ce69 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Tue, 16 Jan 2024 11:06:06 +0100 Subject: [PATCH] build: Make g-ir-scanner warnings fatal when -werror is set This should help catching problems with introspection in CI. This also pulls out some common arguments to the gnome.generate_gir call. Part-of: --- clutter/clutter/meson.build | 8 ++------ cogl/cogl-pango/meson.build | 4 +--- cogl/cogl/meson.build | 4 +--- meson.build | 7 +++++++ mtk/mtk/meson.build | 4 +--- src/meson.build | 4 +--- src/tests/meson.build | 4 +--- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build index 104af00f5..6e91e1d60 100644 --- a/clutter/clutter/meson.build +++ b/clutter/clutter/meson.build @@ -323,9 +323,7 @@ if have_introspection ], dependencies: [cogl_deps], extra_args: clutter_introspection_args + ['--c-include=clutter/clutter.h'], - install_dir_gir: pkglibdir, - install_dir_typelib: pkglibdir, - install: true, + kwargs: introspection_common, ) libmutter_cally_gir = gnome.generate_gir(libmutter_clutter, @@ -344,9 +342,7 @@ if have_introspection ], dependencies: [cogl_deps], extra_args: clutter_introspection_args, - install_dir_gir: pkglibdir, - install_dir_typelib: pkglibdir, - install: true + kwargs: introspection_common, ) endif diff --git a/cogl/cogl-pango/meson.build b/cogl/cogl-pango/meson.build index 04cb1e9f1..f45929c2e 100644 --- a/cogl/cogl-pango/meson.build +++ b/cogl/cogl-pango/meson.build @@ -60,9 +60,7 @@ if have_introspection '-UCOGL_COMPILATION', '-DG_LOG_DOMAIN="CoglPango"', ], - install_dir_gir: pkglibdir, - install_dir_typelib: pkglibdir, - install: true + kwargs: introspection_common, ) endif diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build index 414171705..eef229840 100644 --- a/cogl/cogl/meson.build +++ b/cogl/cogl/meson.build @@ -426,9 +426,7 @@ if have_introspection '-DCOGL_GIR_SCANNING', ], header: 'cogl/cogl.h', - install_dir_gir: pkglibdir, - install_dir_typelib: pkglibdir, - install: true + kwargs: introspection_common, ) endif diff --git a/meson.build b/meson.build index abef74c6a..99803df86 100644 --- a/meson.build +++ b/meson.build @@ -324,6 +324,13 @@ if have_introspection '--quiet', '-U_GNU_SOURCE', ] + + introspection_common = { + 'install_dir_gir': pkglibdir, + 'install_dir_typelib': pkglibdir, + 'install': true, + 'fatal_warnings': get_option('werror'), + } endif have_documentation = get_option('docs') diff --git a/mtk/mtk/meson.build b/mtk/mtk/meson.build index 456cdb992..374e82335 100644 --- a/mtk/mtk/meson.build +++ b/mtk/mtk/meson.build @@ -67,9 +67,7 @@ if have_introspection 'Graphene-1.0', ], extra_args: mtk_introspection_args + ['--c-include=mtk/mtk.h'], - install_dir_gir: pkglibdir, - install_dir_typelib: pkglibdir, - install: true, + kwargs: introspection_common, ) endif diff --git a/src/meson.build b/src/meson.build index 6e2ecd335..21006707a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1274,9 +1274,7 @@ if have_introspection ], export_packages: 'libmutter-@0@'.format(libmutter_api_version), extra_args: mutter_c_args + introspection_args, - install_dir_gir: pkglibdir, - install_dir_typelib: pkglibdir, - install: true + kwargs: introspection_common, ) endif diff --git a/src/tests/meson.build b/src/tests/meson.build index 2934315a3..bb630cbb9 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -98,9 +98,7 @@ if have_introspection mutter_deps, ], extra_args: mutter_c_args + introspection_args, - install_dir_gir: pkglibdir, - install_dir_typelib: pkglibdir, - install: true + kwargs: introspection_common, ) endif