aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2017-12-14 09:49:23 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2017-12-20 19:09:08 -0500
commit9e541a0fff9b2f345fc76d807a2c99555394930f (patch)
tree6befe6794e4be2eff220b8b39fcc83386209a970 /mesonbuild/modules/pkgconfig.py
parent1c0570906c644df619ce463b9c3715dd492e1c8f (diff)
downloadmeson-9e541a0fff9b2f345fc76d807a2c99555394930f.zip
meson-9e541a0fff9b2f345fc76d807a2c99555394930f.tar.gz
meson-9e541a0fff9b2f345fc76d807a2c99555394930f.tar.bz2
pkgconfig: Avoid duplicated -L flags
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r--mesonbuild/modules/pkgconfig.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 7a54a84..44add61 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -171,6 +171,7 @@ class PkgConfigModule(ExtensionModule):
msg = 'Library target {0!r} has {1!r} set. Compilers ' \
'may not find it from its \'-l{2}\' linker flag in the ' \
'{3!r} pkg-config file.'
+ Lflags = []
for l in libs:
if isinstance(l, str):
yield l
@@ -179,9 +180,12 @@ class PkgConfigModule(ExtensionModule):
if install_dir is False:
continue
if isinstance(install_dir, str):
- yield '-L${prefix}/%s ' % self._escape(self._make_relative(prefix, install_dir))
+ Lflag = '-L${prefix}/%s ' % self._escape(self._make_relative(prefix, install_dir))
else: # install_dir is True
- yield '-L${libdir}'
+ Lflag = '-L${libdir}'
+ if Lflag not in Lflags:
+ Lflags.append(Lflag)
+ yield Lflag
lname = self._get_lname(l, msg, pcfile)
# If using a custom suffix, the compiler may not be able to
# find the library