[PATCH] meson.build: make special_funcs check more reliable
authorGiulio Benetti <giulio.benetti@benettiengineering.com>
Fri, 25 Apr 2025 17:00:14 +0000 (19:00 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Fri, 16 May 2025 19:59:04 +0000 (19:59 +0000)
Unfortunately while cross-compiling with build tools like Buildroot it
happens to have repeated flags or anything that could lead to a warning.
This way the check fails because of a warning not related to the special
function. So let's use cc.links() and increase minimum meson_version to
0.60 since cc.links() has been added during that version.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Gbp-Pq: Name meson.build-make-special_funcs-check-more-reliable.patch

meson.build

index d1346d090325a13382e6f465a7f626befc91e3c7..d3d236dc435adcdb1144e87148fe8279c517f057 100644 (file)
@@ -1,6 +1,6 @@
 project('libfuse3', ['c'],
         version: '3.17.2',
-        meson_version: '>= 0.51.0',
+        meson_version: '>= 0.60.0',
         default_options: [
             'buildtype=debugoptimized',
             'c_std=gnu11',
@@ -108,7 +108,7 @@ special_funcs = {
 
 foreach name, code : special_funcs
     private_cfg.set('HAVE_' + name.to_upper(),
-        cc.compiles(code, args: ['-Werror'] + args_default,
+        cc.links(code, args: args_default,
                  name: name + ' check'))
 endforeach