SHA256
3
0
forked from pool/meson
meson/7930.patch

54 lines
2.5 KiB
Diff
Raw Normal View History

From 2b923f532c3e16687910fecb09cedb80a76597cf Mon Sep 17 00:00:00 2001
From: Xavier Claessens <xavier.claessens@collabora.com>
Date: Tue, 3 Nov 2020 09:39:39 -0500
Subject: [PATCH] pkgconfig: Make external deps of static library public
This fix a regression caused by
https://github.com/mesonbuild/meson/pull/7837, it wanted to make
InternalDependency's external_deps private but has side effect of making
StatisLibrary's external_deps private too.
It is technically correct to make them private, but Meson used to make
StaticLibrary deps public so they are usable without `pkg-config
--static` when we know there is only a static library available.
Fixes: #7929.
---
mesonbuild/modules/pkgconfig.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index a863b33c93..62e1c1595c 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -131,7 +131,7 @@ def _process_libs(self, libs, public):
if obj.found():
processed_libs += obj.get_link_args()
processed_cflags += obj.get_compile_args()
- self._add_lib_dependencies(obj.libraries, obj.whole_libraries, obj.ext_deps, public)
+ self._add_lib_dependencies(obj.libraries, obj.whole_libraries, obj.ext_deps, public, private_external_deps=True)
elif isinstance(obj, dependencies.Dependency):
if obj.found():
processed_libs += obj.get_link_args()
@@ -160,7 +160,7 @@ def _process_libs(self, libs, public):
return processed_libs, processed_reqs, processed_cflags
- def _add_lib_dependencies(self, link_targets, link_whole_targets, external_deps, public):
+ def _add_lib_dependencies(self, link_targets, link_whole_targets, external_deps, public, private_external_deps=False):
add_libs = self.add_pub_libs if public else self.add_priv_libs
# Recursively add all linked libraries
for t in link_targets:
@@ -173,7 +173,10 @@ def _add_lib_dependencies(self, link_targets, link_whole_targets, external_deps,
for t in link_whole_targets:
self._add_link_whole(t, public)
# And finally its external dependencies
- self.add_priv_libs(external_deps)
+ if private_external_deps:
+ self.add_priv_libs(external_deps)
+ else:
+ add_libs(external_deps)
def _add_link_whole(self, t, public):
# Don't include static libraries that we link_whole. But we still need to