diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 37c9c1db5..68e543078 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -50,6 +50,7 @@ from .interpreterobjects import ( NullSubprojectInterpreter, ) from .type_checking import ( + DEPENDS_KW, DEPFILE_KW, ENV_KW, INSTALL_MODE_KW, @@ -1676,12 +1677,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self listify=True, default=[], ), - KwargInfo( - 'depends', - ContainerTypeInfo(list, (build.BuildTarget, build.CustomTarget)), - listify=True, - default=[], - ), + DEPENDS_KW, ENV_KW.evolve(since='0.57.0'), ) def func_run_target(self, node: mparser.FunctionNode, args: T.Tuple[str], diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index d8559541e..db346afdd 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -6,7 +6,7 @@ import typing as T from .. import compilers -from ..build import EnvironmentVariables +from ..build import EnvironmentVariables, CustomTarget, BuildTarget from ..coredata import UserFeatureOption from ..interpreterbase import TYPE_var from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo @@ -183,3 +183,10 @@ DEPFILE_KW: KwargInfo[T.Optional[str]] = KwargInfo( (str, type(None)), validator=lambda x: 'Depfile must be a plain filename with a subdirectory' if has_path_sep(x) else None ) + +DEPENDS_KW: KwargInfo[T.List[T.Union[BuildTarget, CustomTarget]]] = KwargInfo( + 'depends', + ContainerTypeInfo(list, (BuildTarget, CustomTarget)), + listify=True, + default=[], +)