summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-11-17 10:22:03 -0500
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2021-12-22 08:04:08 +0530
commit95a4c6a62a925fc888e7c07ae3d9937c87e1c759 (patch)
tree2cdaceb586e019c60316995c1504e5d45b36385a /mesonbuild/modules/pkgconfig.py
parentee0baa97cd0411e15bd8f47e3874f217887d0a7a (diff)
downloadmeson-95a4c6a62a925fc888e7c07ae3d9937c87e1c759.tar.gz
pkgconfig: Fix linking to a custom target
When generating pkgconfig file for a library that links to an uninstalled static library built by custom_target() Meson was crashing when trying to access some attributes that does not exist on that class. Also fix is_internal() implementation, it only really make sense on a CustomTargetIndex or if CustomTarget has only a single output.
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r--mesonbuild/modules/pkgconfig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 4a0b39e81..6c5d347c3 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -183,7 +183,8 @@ class DependenciesHelper:
# lists in case a library is link_with and link_whole at the same time.
# See remove_dups() below.
self.link_whole_targets.append(t)
- self._add_lib_dependencies(t.link_targets, t.link_whole_targets, t.external_deps, public)
+ if isinstance(t, build.BuildTarget):
+ self._add_lib_dependencies(t.link_targets, t.link_whole_targets, t.external_deps, public)
def add_version_reqs(self, name, version_reqs):
if version_reqs: