interpreter: move DEPFILE_KW to type_checkingt

pull/9329/head
Dylan Baker 3 years ago committed by Daniel Mensinger
parent d25349e8cf
commit d9c32f32d1
  1. 3
      mesonbuild/interpreter/interpreter.py
  2. 8
      mesonbuild/interpreter/type_checking.py

@ -50,6 +50,7 @@ from .interpreterobjects import (
NullSubprojectInterpreter,
)
from .type_checking import (
DEPFILE_KW,
ENV_KW,
INSTALL_MODE_KW,
LANGUAGE_KW,
@ -1717,7 +1718,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
'generator',
KwargInfo('arguments', ContainerTypeInfo(list, str, allow_empty=False), required=True, listify=True),
KwargInfo('output', ContainerTypeInfo(list, str, allow_empty=False), required=True, listify=True),
KwargInfo('depfile', (str, NoneType), validator=lambda x: 'Depfile must be a plain filename with a subdirectory' if has_path_sep(x) else None),
DEPFILE_KW,
KwargInfo('capture', bool, default=False, since='0.43.0'),
KwargInfo('depends', ContainerTypeInfo(list, (build.BuildTarget, build.CustomTarget)), default=[], listify=True),
)

@ -10,7 +10,7 @@ from ..build import EnvironmentVariables
from ..coredata import UserFeatureOption
from ..interpreterbase import TYPE_var
from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo
from ..mesonlib import FileMode, MachineChoice, listify
from ..mesonlib import FileMode, MachineChoice, listify, has_path_sep
# Helper definition for type checks that are `Optional[T]`
NoneType: T.Type[None] = type(None)
@ -177,3 +177,9 @@ ENV_KW: KwargInfo[T.Union[EnvironmentVariables, T.List, T.Dict, str, None]] = Kw
validator=_env_validator,
convertor=_env_convertor,
)
DEPFILE_KW = KwargInfo(
'depfile',
str,
validator=lambda x: 'Depfile must be a plain filename with a subdirectory' if has_path_sep(x) else None
)

Loading…
Cancel
Save