]> xenbits.xensource.com Git - libvirt.git/commitdiff
meson: Fix yajl workaround
authorAndrea Bolognani <abologna@redhat.com>
Sat, 8 Jan 2022 10:36:47 +0000 (11:36 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 10 Jan 2022 08:46:06 +0000 (09:46 +0100)
Meson reports

  WARNING: pkgconfig variable 'cflags' not defined for dependency yajl.

which makes sense, because "cflags" is not one of the variables
reported by

  $ pkg-config --print-variables yajl

and

  $ pkg-config --variable=cflags yajl

doesn't work either.

The breakage was introduced when we switched from calling
pkg-config directly to using get_pkgconfig_variable() in 7.5.0
and, somehow, it went undetected until now.

Use "includedir", which is a proper pkg-config variable,
instead.

Fixes: c32c5ca29aeb63d329e2c1e60e249246c010f2f3
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
meson.build

index ec7dcffac44c3548d20c353fcbdd83be9cce3050..214a3f05eb1bb1c4344183a9a81200fa1e8258eb 100644 (file)
@@ -1356,17 +1356,18 @@ if yajl_dep.found()
   #
   # [1] https://github.com/Homebrew/homebrew-core/pull/74516
   if host_machine.system() != 'linux'
-    cflags = yajl_dep.get_pkgconfig_variable('cflags')
-    if cflags.contains('include/yajl')
+    includedir = yajl_dep.get_pkgconfig_variable('includedir')
+    if includedir.contains('include/yajl')
       rc = run_command(
         'python3', '-c',
         'print("@0@".replace("@1@", "@2@"))'.format(
-          cflags, 'include/yajl', 'include',
+          includedir, 'include/yajl', 'include',
         ),
         check: true,
       )
+      includedir = rc.stdout().strip()
       yajl_dep = declare_dependency(
-        compile_args: rc.stdout().strip().split(),
+        compile_args: [ '-I' + includedir ],
         dependencies: [ yajl_dep ],
       )
     endif