From c97075e1e46e9305d62620d8b05046aae0139438 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Sat, 8 Jan 2022 11:36:47 +0100 Subject: [PATCH] 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: c32c5ca29aeb63d329e2c1e60e249246c010f2f3 Signed-off-by: Andrea Bolognani Tested-by: Roman Bolshakov Reviewed-by: Roman Bolshakov --- meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index ec7dcffac4..214a3f05eb 100644 --- a/meson.build +++ b/meson.build @@ -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