aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-03-19 23:43:35 +0200
committerGitHub <noreply@github.com>2018-03-19 23:43:35 +0200
commite984e1072b28abfa4ac278992a8ef6d138c15608 (patch)
tree43cac94062456f8d5ecccc2bcc114623e8200d33 /mesonbuild/modules/pkgconfig.py
parent7eb187c5f2cf55c6d441db08a87bac02cb58a9dc (diff)
parentcf5f1a83d55d05412e29058844e4fda5e420553b (diff)
downloadmeson-e984e1072b28abfa4ac278992a8ef6d138c15608.zip
meson-e984e1072b28abfa4ac278992a8ef6d138c15608.tar.gz
meson-e984e1072b28abfa4ac278992a8ef6d138c15608.tar.bz2
Merge pull request #3251 from mesonbuild/fixpkgconfigdeps
Fix pkg-config dependencies leaking out (debbug 892956)
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r--mesonbuild/modules/pkgconfig.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 074fc5a..c89f657 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -96,7 +96,20 @@ 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)
+ if public:
+ if not hasattr(obj, 'generated_pc'):
+ obj.generated_pc = self.name
+ 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'):