diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-01-10 16:13:03 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-01-29 09:11:24 -0800 |
commit | 8a9d6b1ed918268be9542971cd6221a4b4b0b72b (patch) | |
tree | 4b29df1eda5d2fe49c8e726325d2af35a61f8c46 | |
parent | 751f6fb90f41f1e633b28ca60f6cde2f4c204da3 (diff) | |
download | meson-8a9d6b1ed918268be9542971cd6221a4b4b0b72b.zip meson-8a9d6b1ed918268be9542971cd6221a4b4b0b72b.tar.gz meson-8a9d6b1ed918268be9542971cd6221a4b4b0b72b.tar.bz2 |
dependencies: Add a sub_dependency_method that takes a list of
dependencies
This will be useful for adding dependencies that come from a factory,
and thus are a list.
-rw-r--r-- | mesonbuild/dependencies/base.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 9ae87ab..ed59be2 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -179,6 +179,22 @@ class Dependency: """ raise RuntimeError('Unreachable code in partial_dependency called') + def _add_sub_dependency2(self, deplist: T.List['DependencyType']) -> bool: + """Add an internal depdency from a list of possible dependencies. + + This method is intended to make it easier to add additional + dependencies to another dependency internally. + + Returns true if the dependency was successfully added, false + otherwise. + """ + for d in deplist: + dep = d() + if dep.is_found: + self.ext_deps.append(dep) + return True + return False + def _add_sub_dependency(self, dep_type: T.Type['Dependency'], env: Environment, kwargs: T.Dict[str, T.Any], *, method: DependencyMethods = DependencyMethods.AUTO) -> None: |