On 17/6/25 22:34, Bernhard Beschow wrote:
When compiling QEMU against fuse3-3.17.1 with --enable-werror the build fails
with:
In file included from ../src/block/export/fuse.c:33:
/usr/include/fuse3/fuse.h:959:5: error: redundant redeclaration of
‘fuse_main_real_versioned’ [-Werror=redundant-decls]
959 | int fuse_main_real_versioned(int argc, char *argv[],
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fuse3/fuse.h:885:5: note: previous declaration of
‘fuse_main_real_versioned’ with type ‘int(int, char **, const struct
fuse_operations *, size_t, struct libfuse_version *, void *)’ {aka ‘int(int,
char **, const struct fuse_operations *, long unsigned int, struct
libfuse_version *, void *)’}
885 | int fuse_main_real_versioned(int argc, char *argv[],
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
That is, a fuse header triggers a warning within itself. Since QEMU adds the
fuse3 include path via `-I`, the compiler thinks that the header is part of the
QEMU project, and thus raises a warning. The compiler can be told to ignore
warnings within 3rd party headers by adding these paths via `-isystem`. Fix the
above build failure by marking fuse as system dependency. While at it mark
every 3rd-party dependency as system dependency to prevent similar issues in the
future but skip glib since that results in glib include paths to be omitted from
bindgen in case of a Rust build.
Signed-off-by: Bernhard Beschow <shen...@gmail.com>
---
meson.build | 160 ++++++++++++++++++++++++++--------------------------
1 file changed, 80 insertions(+), 80 deletions(-)
diff --git a/meson.build b/meson.build
index 34729c2a3d..694cf95f6f 100644
--- a/meson.build
+++ b/meson.build
@@ -826,7 +826,7 @@ endif
#####################################
libm = cc.find_library('m', required: false)
-threads = dependency('threads')
+threads = dependency('threads', include_type: 'system')
util = cc.find_library('util', required: false)
winmm = []
socket = []
@@ -859,11 +859,11 @@ if host_os == 'windows'
include_directories:
include_directories('.'))
host_dsosuf = '.dll'
elif host_os == 'darwin'
- coref = dependency('appleframeworks', modules: 'CoreFoundation')
- iokit = dependency('appleframeworks', modules: 'IOKit', required: false)
+ coref = dependency('appleframeworks', modules: 'CoreFoundation',
include_type: 'system')
+ iokit = dependency('appleframeworks', modules: 'IOKit', required: false,
include_type: 'system')
host_dsosuf = '.dylib'
pvg = dependency('appleframeworks', modules: ['ParavirtualizedGraphics',
'Metal'],
- required: get_option('pvg'))
+ required: get_option('pvg'), include_type: 'system')
elif host_os == 'sunos'
socket = [cc.find_library('socket'),
cc.find_library('nsl'),
@@ -899,7 +899,7 @@ endif
hvf = not_found
if get_option('hvf').allowed()
hvf = dependency('appleframeworks', modules: 'Hypervisor',
- required: get_option('hvf'))
+ required: get_option('hvf'), include_type: 'system')
if hvf.found()
accelerators += 'CONFIG_HVF'
endif
To the best of my meson knowledge:
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>