diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2017-12-14 11:13:37 -0500 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2017-12-20 19:09:08 -0500 |
commit | 49977686b57685decfeda726958c33610710eb2e (patch) | |
tree | d72d0ca09d4f5a7e250f852d7be2545f08490604 /mesonbuild/modules/pkgconfig.py | |
parent | 9e541a0fff9b2f345fc76d807a2c99555394930f (diff) | |
download | meson-49977686b57685decfeda726958c33610710eb2e.zip meson-49977686b57685decfeda726958c33610710eb2e.tar.gz meson-49977686b57685decfeda726958c33610710eb2e.tar.bz2 |
pkgconfig: Use the pc file we generated for libraries
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 44add61..c938d42 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -24,7 +24,8 @@ from . import ExtensionModule from ..interpreterbase import permittedKwargs class DepsHolder: - def __init__(self): + def __init__(self, name): + self.name = name self.pub_libs = [] self.pub_reqs = [] self.priv_libs = [] @@ -62,6 +63,8 @@ class DepsHolder: if hasattr(obj, 'pcdep'): pcdeps = mesonlib.listify(obj.pcdep) processed_reqs += [i.name for i in pcdeps] + elif hasattr(obj, 'generated_pc'): + processed_reqs.append(obj.generated_pc) elif isinstance(obj, dependencies.PkgConfigDependency): processed_reqs.append(obj.name) elif isinstance(obj, dependencies.ThreadDependency): @@ -73,6 +76,8 @@ class DepsHolder: elif isinstance(obj, (build.SharedLibrary, build.StaticLibrary)): processed_libs.append(obj) if public: + if not hasattr(obj, 'generated_pc'): + obj.generated_pc = self.name self.add_priv_libs(obj.get_dependencies()) self.add_priv_libs(obj.get_external_deps()) elif isinstance(obj, str): @@ -216,13 +221,6 @@ class PkgConfigModule(ExtensionModule): if len(args) > 0: raise mesonlib.MesonException('Pkgconfig_gen takes no positional arguments.') - deps = DepsHolder() - deps.add_pub_libs(kwargs.get('libraries', [])) - deps.add_priv_libs(kwargs.get('libraries_private', [])) - deps.add_pub_reqs(kwargs.get('requires', [])) - deps.add_priv_reqs(kwargs.get('requires_private', [])) - deps.add_cflags(kwargs.get('extra_cflags', [])) - subdirs = mesonlib.stringlistify(kwargs.get('subdirs', ['.'])) version = kwargs.get('version', None) if not isinstance(version, str): @@ -241,6 +239,13 @@ class PkgConfigModule(ExtensionModule): raise mesonlib.MesonException('URL is not a string.') conflicts = mesonlib.stringlistify(kwargs.get('conflicts', [])) + deps = DepsHolder(filebase) + deps.add_pub_libs(kwargs.get('libraries', [])) + deps.add_priv_libs(kwargs.get('libraries_private', [])) + deps.add_pub_reqs(kwargs.get('requires', [])) + deps.add_priv_reqs(kwargs.get('requires_private', [])) + deps.add_cflags(kwargs.get('extra_cflags', [])) + dversions = kwargs.get('d_module_versions', None) if dversions: compiler = state.environment.coredata.compilers.get('d') |