interpreter: use typed_kwargs for include_directories

pull/8953/head
Dylan Baker 4 years ago
parent 3135b130b8
commit 09d7da19c1
  1. 6
      mesonbuild/interpreter/interpreter.py
  2. 5
      mesonbuild/interpreter/kwargs.py

@ -2268,11 +2268,11 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
raise InterpreterException('Include directory objects can only be created from strings or include directories.') raise InterpreterException('Include directory objects can only be created from strings or include directories.')
return result return result
@permittedKwargs({'is_system'})
@typed_pos_args('include_directories', varargs=str) @typed_pos_args('include_directories', varargs=str)
@typed_kwargs('include_directories', KwargInfo('is_system', bool, default=False))
def func_include_directories(self, node: mparser.BaseNode, args: T.Tuple[T.List[str]], def func_include_directories(self, node: mparser.BaseNode, args: T.Tuple[T.List[str]],
kwargs: 'TYPE_kwargs') -> build.IncludeDirs: kwargs: 'kwargs.FuncIncludeDirectories') -> build.IncludeDirs:
return self.build_incdir_object(args[0], kwargs.get('is_system', False)) return self.build_incdir_object(args[0], kwargs['is_system'])
def build_incdir_object(self, incdir_strings: T.List[str], is_system: bool = False) -> build.IncludeDirs: def build_incdir_object(self, incdir_strings: T.List[str], is_system: bool = False) -> build.IncludeDirs:
if not isinstance(is_system, bool): if not isinstance(is_system, bool):

@ -137,3 +137,8 @@ class FuncInstallMan(TypedDict):
class FuncImportModule(ExtractRequired): class FuncImportModule(ExtractRequired):
disabler: bool disabler: bool
class FuncIncludeDirectories(TypedDict):
is_system: bool

Loading…
Cancel
Save