diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-10-01 09:14:16 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-07 12:33:33 -0800 |
commit | ba3d9b5d1616af4380bddbcbdacab4a3fcff6150 (patch) | |
tree | 394b1f8499f04b43586a5734e209d98cb9e521b0 /mesonbuild/dependencies/base.py | |
parent | 39433762a9af1624be1c581b6f5cdb105b86bcd1 (diff) | |
download | meson-ba3d9b5d1616af4380bddbcbdacab4a3fcff6150.zip meson-ba3d9b5d1616af4380bddbcbdacab4a3fcff6150.tar.gz meson-ba3d9b5d1616af4380bddbcbdacab4a3fcff6150.tar.bz2 |
dependencies: Dependency Sources can be StructuredSources
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index c5c62d5..7b85159 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -14,6 +14,8 @@ # This file contains the detection logic for external dependencies. # Custom logic for several other packages are in separate files. + +from __future__ import annotations import copy import os import collections @@ -29,6 +31,7 @@ from ..mesonlib import version_compare_many if T.TYPE_CHECKING: from .._typing import ImmutableListProtocol + from ..build import StructuredSources from ..compilers.compilers import Compiler from ..environment import Environment from ..interpreterbase import FeatureCheckBase @@ -91,7 +94,7 @@ class Dependency(HoldableObject): # Raw -L and -l arguments without manual library searching # If None, self.link_args will be used self.raw_link_args: T.Optional[T.List[str]] = None - self.sources: T.List[T.Union['FileOrString', 'CustomTarget']] = [] + self.sources: T.List[T.Union['FileOrString', 'CustomTarget', 'StructuredSources']] = [] self.include_type = self._process_include_type_kw(kwargs) self.ext_deps: T.List[Dependency] = [] self.d_features: T.DefaultDict[str, T.List[T.Any]] = collections.defaultdict(list) @@ -148,7 +151,7 @@ class Dependency(HoldableObject): def found(self) -> bool: return self.is_found - def get_sources(self) -> T.List[T.Union['FileOrString', 'CustomTarget']]: + def get_sources(self) -> T.List[T.Union['FileOrString', 'CustomTarget', 'StructuredSources']]: """Source files that need to be added to the target. As an example, gtest-all.cc when using GTest.""" return self.sources @@ -228,7 +231,7 @@ class InternalDependency(Dependency): link_args: T.List[str], libraries: T.List[T.Union['BuildTarget', 'CustomTarget']], whole_libraries: T.List[T.Union['BuildTarget', 'CustomTarget']], - sources: T.Sequence[T.Union['FileOrString', 'CustomTarget']], + sources: T.Sequence[T.Union['FileOrString', 'CustomTarget', StructuredSources]], ext_deps: T.List[Dependency], variables: T.Dict[str, T.Any], d_module_versions: T.List[str], d_import_dirs: T.List['IncludeDirs']): super().__init__(DependencyTypeName('internal'), {}) |