From a864e0418c1f30a558d6fda3eec65d521cb54d87 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 12 Dec 2018 16:06:14 -0500 Subject: pkgconfig: Avoid deprecation warning when using new syntax When using pkg.generate(mylib, library : publicdep) it is pretty clear we don't want to associate publicdep to this generated pkg-config file. This is a small behaviour break in theory, but also fixes real bug in the case publicdep is later used to generate another pkg-config file that does not depend on mylib, that would write a wrong `Requires: mylib` in the genarated pkg-config file. This fix unavoidable deprecation warning when glib is cross built for Android. Glib does `pkg.generate(libglib, libraries : [libintl], ...)` which wrongly associates libintl to the generated glib-2.0.pc, so when later it generates gio-2.0.pc file that depends on libglib, it will warn about libintl being associated with libglib. This does not happen in normal glib build because libintl is usually provided by glibc and is only an internal library when it fallbacks to a subproject. --- mesonbuild/modules/pkgconfig.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index bc9bff8..87e5dcf 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -438,11 +438,12 @@ class PkgConfigModule(ExtensionModule): mainlib.generated_pc = filebase else: mlog.warning('Already generated a pkg-config file for', mlog.bold(mainlib.name)) - for lib in deps.pub_libs: - if not isinstance(lib, str) and not hasattr(lib, 'generated_pc'): - lib.generated_pc = filebase - lib.generated_pc_warn = types.SimpleNamespace(subdir=state.subdir, - lineno=state.current_lineno) + else: + for lib in deps.pub_libs: + if not isinstance(lib, str) and not hasattr(lib, 'generated_pc'): + lib.generated_pc = filebase + lib.generated_pc_warn = types.SimpleNamespace(subdir=state.subdir, + lineno=state.current_lineno) return ModuleReturnValue(res, [res]) def initialize(*args, **kwargs): -- cgit v1.1