diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-08-15 11:47:57 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-08-15 10:29:07 +0000 |
commit | 23f795fb54e1db24ddc29cb46cabdf10914639f9 (patch) | |
tree | 58930aacff20df4dfaaa2ac9b8f07c3841ae5abb /mesonbuild/interpreter.py | |
parent | ee2f32d0c718be2229925b6fcdc6ae3ea8714c82 (diff) | |
download | meson-23f795fb54e1db24ddc29cb46cabdf10914639f9.zip meson-23f795fb54e1db24ddc29cb46cabdf10914639f9.tar.gz meson-23f795fb54e1db24ddc29cb46cabdf10914639f9.tar.bz2 |
find_library: Print type of library not found
If we can't find a static library, we should say that. It's confusing
otherwise.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 2af08ec..b547bbf 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1637,8 +1637,13 @@ class CompilerHolder(InterpreterObject): libtype = mesonlib.LibType.STATIC if kwargs['static'] else mesonlib.LibType.SHARED linkargs = self.compiler.find_library(libname, self.environment, search_dirs, libtype) if required and not linkargs: - raise InterpreterException( - '{} library {!r} not found'.format(self.compiler.get_display_language(), libname)) + if libtype == mesonlib.LibType.PREFER_SHARED: + libtype = 'shared or static' + else: + libtype = libtype.name.lower() + raise InterpreterException('{} {} library {!r} not found' + .format(self.compiler.get_display_language(), + libtype, libname)) lib = dependencies.ExternalLibrary(libname, linkargs, self.environment, self.compiler.language) return ExternalLibraryHolder(lib, self.subproject) |