On Sat, Jan 08, 2022 at 04:29:35PM +0100, Andrea Bolognani wrote:
Recent versions of Meson report
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.
Use "includedir", which is a proper pkg-config variable,
instead.
Hi Andrea,
The fix helps, thanks!
Reviewed-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
Tested-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
FWIW, I've tried to figure out where it went broken and it turned out to
be in c32c5ca29ae. Newer meson is not related to the issue.
So you might want to add the tag:
Fixes: c32c5ca29ae ("meson: Use get_pkgconfig_variable('cflags')")
Regards,
Roman
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
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(a)",
"@2(a)"))'.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
--
2.31.1