diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-01-07 15:47:55 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-01-29 09:11:24 -0800 |
commit | 29b6d3e63ce6b18fa159a9d36de77c4f78c8bcc9 (patch) | |
tree | d6d6c2e7f63e2ddf90540d74ace2140df47af8c5 /mesonbuild/dependencies/base.py | |
parent | 8a9d6b1ed918268be9542971cd6221a4b4b0b72b (diff) | |
download | meson-29b6d3e63ce6b18fa159a9d36de77c4f78c8bcc9.zip meson-29b6d3e63ce6b18fa159a9d36de77c4f78c8bcc9.tar.gz meson-29b6d3e63ce6b18fa159a9d36de77c4f78c8bcc9.tar.bz2 |
dependencies: Use a DependencyFactory for LLVM
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index ed59be2..0596395 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -2212,6 +2212,7 @@ class DependencyFactory: """ def __init__(self, name: str, methods: T.List[DependencyMethods], *, + extra_kwargs: T.Optional[T.Dict[str, T.Any]] = None, pkgconfig_name: T.Optional[str] = None, pkgconfig_class: 'T.Type[PkgConfigDependency]' = PkgConfigDependency, cmake_name: T.Optional[str] = None, @@ -2224,6 +2225,7 @@ class DependencyFactory: if DependencyMethods.CONFIG_TOOL in methods and not configtool_class: raise DependencyException('A configtool must have a custom class') + self.extra_kwargs = extra_kwargs or {} self.methods = methods self.classes = { # Just attach the correct name right now, either the generic name @@ -2256,8 +2258,10 @@ class DependencyFactory: kwargs: T.Dict[str, T.Any]) -> T.List['DependencyType']: """Return a list of Dependencies with the arguments already attached.""" methods = process_method_kw(self.methods, kwargs) + nwargs = self.extra_kwargs.copy() + nwargs.update(kwargs) - return [functools.partial(self.classes[m], env, kwargs) for m in methods + return [functools.partial(self.classes[m], env, nwargs) for m in methods if self._process_method(m, env, for_machine)] |