From f49d883d4de4011365ca3644fcd1914df5193227 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Wed, 24 May 2023 17:31:23 +0000 Subject: [PATCH] meson.build: Fix glib -Wno-unused-function workaround MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We want to only enable '-Wno-unused-function' if glib's version is smaller than '2.57.2' and has a G_DEFINE_AUTOPTR_CLEANUP_FUNC() implementation that doesn't take into account unused functions. But the compilation test isn't working as intended as '-Wunused-function' isn't enabled while running it. Let's enable it. Fixes: fc9a809e0d28 ("build: move glib detection and workarounds to meson") Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230524173123.66483-1-nsaenz@amazon.com> Signed-off-by: Paolo Bonzini --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0a5cdefd4d..448b71ad5b 100644 --- a/meson.build +++ b/meson.build @@ -770,7 +770,7 @@ if not cc.compiles(''' g_free(f); } G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free) - int main(void) { return 0; }''', dependencies: glib_pc, args: ['-Werror']) + int main(void) { return 0; }''', dependencies: glib_pc, args: ['-Wunused-function', '-Werror']) glib_cflags += cc.get_supported_arguments('-Wno-unused-function') endif glib = declare_dependency(dependencies: [glib_pc, gmodule], -- 2.30.2