diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-08 16:32:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-08 16:32:50 +0300 |
commit | 23a7fe06e982fbe5d076153ef912cb3009eb1f3f (patch) | |
tree | d6b148e29dead56af21d9bd348d043542e616c93 /mesonbuild | |
parent | d6e71d0c566416c0ba940323c6f2734695c999d0 (diff) | |
parent | da0f0f02e5463fa04bcb475a108485362a70e261 (diff) | |
download | meson-23a7fe06e982fbe5d076153ef912cb3009eb1f3f.zip meson-23a7fe06e982fbe5d076153ef912cb3009eb1f3f.tar.gz meson-23a7fe06e982fbe5d076153ef912cb3009eb1f3f.tar.bz2 |
Merge pull request #3366 from xclaesse/pkgconfig-dup-version
Remove duplicates in generated pkgconfig required versions
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index c587f84..11fa80d 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -87,6 +87,7 @@ class DependenciesHelper: processed_reqs = [] processed_cflags = [] for obj in libs: + shared_library_only = getattr(obj, 'shared_library_only', False) if hasattr(obj, 'pcdep'): pcdeps = mesonlib.listify(obj.pcdep) for d in pcdeps: @@ -105,7 +106,7 @@ class DependenciesHelper: if obj.found(): processed_libs += obj.get_link_args() processed_cflags += obj.get_compile_args() - elif isinstance(obj, build.SharedLibrary) and obj.shared_library_only: + elif isinstance(obj, build.SharedLibrary) and shared_library_only: # Do not pull dependencies for shared libraries because they are # only required for static linking. Adding private requires has # the side effect of exposing their cflags, which is the @@ -132,9 +133,11 @@ class DependenciesHelper: def add_version_reqs(self, name, version_reqs): if version_reqs: - vreqs = self.version_reqs.get(name, []) - vreqs += mesonlib.stringlistify(version_reqs) - self.version_reqs[name] = vreqs + if name not in self.version_reqs: + self.version_reqs[name] = set() + # We could have '>=1.0' or '>= 1.0', remove spaces to normalize + new_vreqs = [s.replace(' ', '') for s in mesonlib.stringlistify(version_reqs)] + self.version_reqs[name].update(new_vreqs) def split_version_req(self, s): for op in ['>=', '<=', '!=', '==', '=', '>', '<']: |