]> git.proxmox.com Git - mirror_qemu.git/commitdiff
meson.build: Fix glib -Wno-unused-function workaround
authorNicolas Saenz Julienne <nsaenz@amazon.com>
Wed, 24 May 2023 17:31:23 +0000 (17:31 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 25 May 2023 08:02:37 +0000 (10:02 +0200)
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 <nsaenz@amazon.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230524173123.66483-1-nsaenz@amazon.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
meson.build

index 0a5cdefd4d3da08b857b0d37051076daf316695f..448b71ad5b5c64ac778a021a842ce0c58ba42d53 100644 (file)
@@ -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],