From 95a4c6a62a925fc888e7c07ae3d9937c87e1c759 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 17 Nov 2020 10:22:03 -0500 Subject: 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. --- mesonbuild/modules/pkgconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mesonbuild/modules/pkgconfig.py') 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: -- cgit v1.2.3