diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-02-21 21:49:13 -0500 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-01 12:13:24 -0800 |
commit | 23e767176e832768d9c1f8c87efbe2bda69ee1c1 (patch) | |
tree | 824f0697352ddd9c98b69adb0d609f07d40b81e1 /mesonbuild/dependencies/base.py | |
parent | d39b3300753dca459f300e29fad7d8f74013c721 (diff) | |
download | meson-23e767176e832768d9c1f8c87efbe2bda69ee1c1.zip meson-23e767176e832768d9c1f8c87efbe2bda69ee1c1.tar.gz meson-23e767176e832768d9c1f8c87efbe2bda69ee1c1.tar.bz2 |
allow dependency checks to bubble up feature warnings to the interpreter
It would be too difficult and probably a layering violation to give an
interpreter handle to the inner guts of every dependency. What we can do
instead is let every dependency track:
- the Feature checks it can produce,
- the version attribute for when it was implemented
while leaving the interpreter in charge of actually emitting them.
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 31c6806..714562f 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -30,6 +30,7 @@ if T.TYPE_CHECKING: from .._typing import ImmutableListProtocol from ..compilers.compilers import Compiler from ..environment import Environment + from ..interpreterbase import FeatureCheckBase from ..build import BuildTarget, CustomTarget, IncludeDirs from ..mesonlib import FileOrString @@ -92,6 +93,8 @@ class Dependency(HoldableObject): self.sources: T.List[T.Union['FileOrString', 'CustomTarget']] = [] self.include_type = self._process_include_type_kw(kwargs) self.ext_deps: T.List[Dependency] = [] + self.featurechecks: T.List['FeatureCheckBase'] = [] + self.feature_since: T.Optional[T.Tuple[str, str]] = None def __repr__(self) -> str: return f'<{self.__class__.__name__} {self.name}: {self.is_found}>' |