aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-12-12 16:06:14 -0500
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-01-31 12:48:28 +0530
commitd28b75a500e0478deea0a4089c2d4bd334f197c8 (patch)
tree7c99a70681cbf7d8a9c360de2070abe351a29478 /mesonbuild/modules/pkgconfig.py
parent36779c0500ac77fbd5e442e98b2971bd3b321ff4 (diff)
downloadmeson-d28b75a500e0478deea0a4089c2d4bd334f197c8.zip
meson-d28b75a500e0478deea0a4089c2d4bd334f197c8.tar.gz
meson-d28b75a500e0478deea0a4089c2d4bd334f197c8.tar.bz2
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.
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r--mesonbuild/modules/pkgconfig.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 05fcd5e..0e232a0 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):