aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-09-18 23:50:12 -0400
committerXavier Claessens <xclaesse@gmail.com>2019-10-01 13:06:45 -0400
commit19fc692b2554a03c0452001ca17d635f2445fafa (patch)
treea11a45d9abdc7a6364ea333e7b88783cf8baffee /mesonbuild/build.py
parentdc5ad1fad953d8cc2191aed1bd6c7c7db83faf99 (diff)
downloadmeson-19fc692b2554a03c0452001ca17d635f2445fafa.zip
meson-19fc692b2554a03c0452001ca17d635f2445fafa.tar.gz
meson-19fc692b2554a03c0452001ca17d635f2445fafa.tar.bz2
pkgconfig: Include dependencies of uninstalled static libraries
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py27
1 files changed, 10 insertions, 17 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index bb5d9db..49c1808 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -974,20 +974,17 @@ This will become a hard error in a future Meson release.''')
transitive_deps = []
if exclude is None:
exclude = []
- if not for_pkgconfig:
- link_targets = itertools.chain(self.link_targets, self.link_whole_targets)
- else:
- # We don't want the 'internal' libraries when generating the
- # `Libs:` and `Libs.private:` lists in pkg-config files.
- link_targets = self.link_targets
- for t in link_targets:
+ for t in itertools.chain(self.link_targets, self.link_whole_targets):
if t in transitive_deps or t in exclude:
continue
- if for_pkgconfig and t.is_internal():
- # Skip uninstalled static libraries, they have been promoted to
- # link_whole into the static library.
- continue
- transitive_deps.append(t)
+ # When generating `Libs:` and `Libs.private:` lists in pkg-config
+ # files we don't want to include static libraries that we link_whole
+ # or are uninstalled (they're implicitly promoted to link_whole).
+ # But we still need to include their transitive dependencies,
+ # a static library we link_whole would itself link to a shared
+ # library or an installed static library.
+ if not for_pkgconfig or (not t.is_internal() and t not in self.link_whole_targets):
+ transitive_deps.append(t)
if isinstance(t, StaticLibrary):
transitive_deps += t.get_dependencies(transitive_deps + exclude, for_pkgconfig)
return transitive_deps
@@ -1114,11 +1111,7 @@ You probably should put it in link_with instead.''')
# When we're a static library and we link_whole: to another static
# library, we need to add that target's objects to ourselves.
self.objects.append(t.extract_all_objects())
- # Add internal and external deps
- self.external_deps += t.external_deps
- self.link_targets += t.link_targets
- else:
- self.link_whole_targets.append(t)
+ self.link_whole_targets.append(t)
def add_pch(self, language, pchlist):
if not pchlist: