From 6ce42e2ec51a9f9b48b6d00303bf5dfc1596498e Mon Sep 17 00:00:00 2001 From: getzze Date: Tue, 10 Oct 2017 23:18:19 +0100 Subject: [PATCH] Error for Libs in package_config function Without specifying a custom install directory string, get_custom_install_dir() returns True. So for the `Libs` entry I was getting this: Libs: -L${prefix}/True -lfoo Now it behaves as expected: Libs: -L${libdir} -lfoo --- mesonbuild/modules/pkgconfig.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index aaed820c8..8383a3aaa 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -80,9 +80,11 @@ class PkgConfigModule(ExtensionModule): yield l else: install_dir = l.get_custom_install_dir()[0] - if install_dir: + if install_dir is False: + continue + if isinstance(install_dir, str): yield '-L${prefix}/%s ' % install_dir - else: + else: # install_dir is True yield '-L${libdir}' lname = self._get_lname(l, msg, pcfile) # If using a custom suffix, the compiler may not be able to