1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

meson: Fix yajl workaround

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: c32c5ca29a
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
This commit is contained in:
Andrea Bolognani 2022-01-08 11:36:47 +01:00
parent ad37e05e26
commit c97075e1e4

View File

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