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.
This commit is contained in:
Xavier Claessens 2018-12-12 16:06:14 -05:00 committed by Nirbheek Chauhan
parent 36779c0500
commit d28b75a500
1 changed files with 6 additions and 5 deletions

View File

@ -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):