aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-12-12 16:06:14 -0500
committerNirbheek Chauhan <nirbheek@centricular.com>2019-02-01 11:30:36 +0530
commita864e0418c1f30a558d6fda3eec65d521cb54d87 (patch)
tree859b40e301aa885dd412c5f03a2ed77725119bb2
parent9c197149d395dbd214adfe2768bfec166714a832 (diff)
downloadmeson-a864e0418c1f30a558d6fda3eec65d521cb54d87.zip
meson-a864e0418c1f30a558d6fda3eec65d521cb54d87.tar.gz
meson-a864e0418c1f30a558d6fda3eec65d521cb54d87.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.
-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 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):