@FeatureNewKwargs('compiler.find_library', '0.51.0', ['static'])
@FeatureNewKwargs('compiler.find_library', '0.50.0', ['has_headers'])
@FeatureNewKwargs('compiler.find_library', '0.49.0', ['disabler'])
@disablerIfNotFound
@permittedKwargs(find_library_permitted_kwargs)
def find_library_method(self, args, kwargs):
    if (len(args) != 1):
        raise InterpreterException('find_library method takes one argument.')
    libname = args[0]
    if (not isinstance(libname, str)):
        raise InterpreterException('Library name not a string.')
    (disabled, required, feature) = extract_required_kwarg(kwargs, self.subproject)
    if disabled:
        mlog.log('Library', mlog.bold(libname), 'skipped: feature', mlog.bold(feature), 'disabled')
        return self.notfound_library(libname)
    has_header_kwargs = {k[7:]: v for (k, v) in kwargs.items() if k.startswith('header_')}
    has_header_kwargs['required'] = required
    headers = mesonlib.stringlistify(kwargs.get('has_headers', []))
    for h in headers:
        if (not self.has_header_method([h], has_header_kwargs)):
            return self.notfound_library(libname)
    search_dirs = extract_search_dirs(kwargs)
    libtype = mesonlib.LibType.PREFER_SHARED
    if ('static' in kwargs):
        if (not isinstance(kwargs['static'], bool)):
            raise InterpreterException('static must be a boolean')
        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))
    lib = dependencies.ExternalLibrary(libname, linkargs, self.environment, self.compiler.language)
    return ExternalLibraryHolder(lib, self.subproject)
@FeatureNewKwargs('compiler.find_library', '0.51.0', ['static'])
@FeatureNewKwargs('compiler.find_library', '0.50.0', ['has_headers'])
@FeatureNewKwargs('compiler.find_library', '0.49.0', ['disabler'])
@disablerIfNotFound
@permittedKwargs(find_library_permitted_kwargs)
def find_library_method(self, args, kwargs):
    if (len(args) != 1):
        raise InterpreterException('find_library method takes one argument.')
    libname = args[0]
    if (not isinstance(libname, str)):
        raise InterpreterException('Library name not a string.')
    (disabled, required, feature) = extract_required_kwarg(kwargs, self.subproject)
    if disabled:
        mlog.log('Library', mlog.bold(libname), 'skipped: feature', mlog.bold(feature), 'disabled')
        return self.notfound_library(libname)
    has_header_kwargs = {k[7:]: v for (k, v) in kwargs.items() if k.startswith('header_')}
    has_header_kwargs['required'] = required
    headers = mesonlib.stringlistify(kwargs.get('has_headers', []))
    for h in headers:
        if (not self.has_header_method([h], has_header_kwargs)):
            return self.notfound_library(libname)
    search_dirs = extract_search_dirs(kwargs)
    libtype = mesonlib.LibType.PREFER_SHARED
    if ('static' in kwargs):
        if (not isinstance(kwargs['static'], bool)):
            raise InterpreterException('static must be a boolean')
        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))
    lib = dependencies.ExternalLibrary(libname, linkargs, self.environment, self.compiler.language)
    return ExternalLibraryHolder(lib, self.subproject)