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
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