diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index 69706bc88..4281ee420 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -88,7 +88,7 @@ class FuncGenerator(TypedDict): arguments: T.List[str] output: T.List[str] - depfile: bool + depfile: T.Optional[str] capture: bool depends: T.List[T.Union[build.BuildTarget, build.CustomTarget]] diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 3c4c3f0f4..d8559541e 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -178,8 +178,8 @@ ENV_KW: KwargInfo[T.Union[EnvironmentVariables, T.List, T.Dict, str, None]] = Kw convertor=_env_convertor, ) -DEPFILE_KW = KwargInfo( +DEPFILE_KW: KwargInfo[T.Optional[str]] = KwargInfo( 'depfile', - str, + (str, type(None)), validator=lambda x: 'Depfile must be a plain filename with a subdirectory' if has_path_sep(x) else None )