diff options
author | Martin Hostettler <textshell@uchuujin.de> | 2018-02-18 17:55:19 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-14 23:43:29 +0300 |
commit | 3f7c6cf3d6a204e9665faad3c05bb5049f08ac74 (patch) | |
tree | 70ac29c3483fe52c470033e6f593a7d9f2b29b07 /mesonbuild | |
parent | 7c37ca15f38dce30eeef6cd8bc53f25406f9029e (diff) | |
download | meson-3f7c6cf3d6a204e9665faad3c05bb5049f08ac74.zip meson-3f7c6cf3d6a204e9665faad3c05bb5049f08ac74.tar.gz meson-3f7c6cf3d6a204e9665faad3c05bb5049f08ac74.tar.bz2 |
Improve generation of pkg-config files for static only libraries.
Previously pkg-config files generated by the pkgconfig modules for static libraries
with dependencies could only be used in a dependencies with `static: true`.
This was caused by the dependencies only appearing in Libs.private even
if they are needed in the default linking mode. But a user of a
dependency should not have to know if the default linking mode is static
or dynamic; A dependency('somelib') call should always pull in all
needed pieces into the build.
Now for meson build static libraries passed via `libraries` to the generate
method automatically promote dependencies to public.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 6a7e962..6f0e717 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -119,11 +119,15 @@ class DependenciesHelper: obj.generated_pc = self.name elif isinstance(obj, (build.SharedLibrary, build.StaticLibrary)): processed_libs.append(obj) - self.add_priv_libs(obj.get_dependencies()) - self.add_priv_libs(obj.get_external_deps()) if public: if not hasattr(obj, 'generated_pc'): obj.generated_pc = self.name + if isinstance(obj, build.StaticLibrary) and public: + self.add_pub_libs(obj.get_dependencies()) + self.add_pub_libs(obj.get_external_deps()) + else: + self.add_priv_libs(obj.get_dependencies()) + self.add_priv_libs(obj.get_external_deps()) elif isinstance(obj, str): processed_libs.append(obj) else: |