aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-07-01 12:31:31 +0000
committerGitHub <noreply@github.com>2018-07-01 12:31:31 +0000
commit2cbf7caf5c8d81e40c790d41cc3b87d30b40cc9f (patch)
tree8a8c7a3d02f653a137a689c48c27e59009036d45 /mesonbuild/modules/pkgconfig.py
parent76184bb6b8ca59aaf3f71e6bb328dbdbef68bf43 (diff)
downloadmeson-2cbf7caf5c8d81e40c790d41cc3b87d30b40cc9f.zip
meson-2cbf7caf5c8d81e40c790d41cc3b87d30b40cc9f.tar.gz
meson-2cbf7caf5c8d81e40c790d41cc3b87d30b40cc9f.tar.bz2
Nirbheek/fix pkgconfig library dedup (#3813)
* Add a test case for bad de-dup of -framework args https://github.com/mesonbuild/meson/issues/3800 * pkgconfig: Don't naively de-dup all arguments Honestly don't know what I was smoking. Of course the `Libs:` field in a pkg-config file can have arguments other than -l and -L Closes https://github.com/mesonbuild/meson/issues/3800 * pkgconfig module: Fix needlessly aggressive de-dup
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r--mesonbuild/modules/pkgconfig.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 68c2dc5..63d1109 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -170,16 +170,18 @@ class DependenciesHelper:
return ', '.join(result)
def remove_dups(self):
- def _fn(xs):
+ def _fn(xs, libs=False):
# Remove duplicates whilst preserving original order
result = []
for x in xs:
- if x not in result:
+ # Don't de-dup unknown strings to avoid messing up arguments like:
+ # ['-framework', 'CoreAudio', '-framework', 'CoreMedia']
+ if x not in result or (libs and (isinstance(x, str) and not x.endswith(('-l', '-L')))):
result.append(x)
return result
- self.pub_libs = _fn(self.pub_libs)
+ self.pub_libs = _fn(self.pub_libs, True)
self.pub_reqs = _fn(self.pub_reqs)
- self.priv_libs = _fn(self.priv_libs)
+ self.priv_libs = _fn(self.priv_libs, True)
self.priv_reqs = _fn(self.priv_reqs)
self.cflags = _fn(self.cflags)