aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Poirier-Morency <guillaumepoiriermorency@gmail.com>2016-10-07 14:26:55 -0400
committerGuillaume Poirier-Morency <guillaumepoiriermorency@gmail.com>2016-10-16 11:33:31 -0400
commitbda92b37eed1b7226b0d74565c825c79f17617e3 (patch)
treea9ee11f632e47846d9837ffa780df8a726fc8cb1
parent9ebc140832b9a54f4c778c0a7edf84938929f419 (diff)
downloadmeson-bda92b37eed1b7226b0d74565c825c79f17617e3.zip
meson-bda92b37eed1b7226b0d74565c825c79f17617e3.tar.gz
meson-bda92b37eed1b7226b0d74565c825c79f17617e3.tar.bz2
pkgconfig: Accept string for 'libraries' and 'libraries_private'
-rw-r--r--mesonbuild/modules/pkgconfig.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index e7646c9..0cfd309 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -68,16 +68,19 @@ class PkgConfigModule:
'may not find it from its \'-l{2}\' linker flag in the ' \
'{3!r} pkg-config file.'
for l in libs:
- if l.custom_install_dir:
- yield '-L${prefix}/%s ' % l.custom_install_dir
+ if isinstance(l, str):
+ yield l
else:
- yield '-L${libdir}'
- lname = self._get_lname(l, msg, pcfile)
- # If using a custom suffix, the compiler may not be able to
- # find the library
- if l.name_suffix_set:
- mlog.log(mlog.red('WARNING:'), msg.format(l.name, 'name_suffix', lname, pcfile))
- yield '-l%s' % lname
+ if l.custom_install_dir:
+ yield '-L${prefix}/%s ' % l.custom_install_dir
+ else:
+ yield '-L${libdir}'
+ lname = self._get_lname(l, msg, pcfile)
+ # If using a custom suffix, the compiler may not be able to
+ # find the library
+ if l.name_suffix_set:
+ mlog.log(mlog.red('WARNING:'), msg.format(l.name, 'name_suffix', lname, pcfile))
+ yield '-l%s' % lname
if len(libraries) > 0:
ofile.write('Libs: {}\n'.format(' '.join(generate_libs_flags(libraries))))
if len(priv_libs) > 0:
@@ -97,8 +100,8 @@ class PkgConfigModule:
for l in libs:
if hasattr(l, 'held_object'):
l = l.held_object
- if not isinstance(l, (build.SharedLibrary, build.StaticLibrary)):
- raise mesonlib.MesonException('Library argument not a library object.')
+ if not isinstance(l, (build.SharedLibrary, build.StaticLibrary, str)):
+ raise mesonlib.MesonException('Library argument not a library object nor a string.')
processed_libs.append(l)
return processed_libs