From 23f795fb54e1db24ddc29cb46cabdf10914639f9 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 15 Aug 2020 11:47:57 +0530 Subject: find_library: Print type of library not found If we can't find a static library, we should say that. It's confusing otherwise. --- mesonbuild/interpreter.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mesonbuild/interpreter.py') 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) -- cgit v1.1