aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-03-17 00:37:05 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-03-17 00:44:56 +0200
commitc385f7973777e0e7b7e4694d69d6584e2ceae69f (patch)
tree3df52287253b853741d04350c39e836af3069e5c /mesonbuild
parentd532650b0d7fb8bb062d852a8fdecd10be00ce21 (diff)
downloadmeson-c385f7973777e0e7b7e4694d69d6584e2ceae69f.zip
meson-c385f7973777e0e7b7e4694d69d6584e2ceae69f.tar.gz
meson-c385f7973777e0e7b7e4694d69d6584e2ceae69f.tar.bz2
Do not leak out private dependencies for shared libraries.
Diffstat (limited to 'mesonbuild')
-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'):