aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r--mesonbuild/modules/pkgconfig.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 2f4dfae..5254731 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -93,7 +93,17 @@ class DependenciesHelper:
if obj.found():
processed_libs += obj.get_link_args()
processed_cflags += obj.get_compile_args()
- elif isinstance(obj, (build.SharedLibrary, build.StaticLibrary)):
+ elif isinstance(obj, build.SharedLibrary):
+ processed_libs.append(obj)
+ elif isinstance(obj, build.StaticLibrary):
+ # Due to a "feature" in pkgconfig, it leaks out private dependencies.
+ # Thus we will not add them to the pc file unless the target
+ # we are processing is a static library.
+ #
+ # This way (hopefully) "pkgconfig --libs --static foobar" works
+ # and "pkgconfig --cflags/--libs foobar" does not have any trace
+ # of dependencies that the build file creator has not explicitly
+ # added to the dependency list.
processed_libs.append(obj)
if public:
if not hasattr(obj, 'generated_pc'):