interpreter: use typed_kwargs for build_target.extra_files

pull/12392/head
Dylan Baker 1 year ago
parent 357abf51c5
commit ca32ffc157
  1. 4
      mesonbuild/interpreter/interpreter.py
  2. 1
      mesonbuild/interpreter/kwargs.py
  3. 1
      mesonbuild/interpreter/type_checking.py

@ -3322,9 +3322,7 @@ class Interpreter(InterpreterBase, HoldableObject):
sources = self.source_strings_to_files(sources)
objs = extract_as_list(kwargs, 'objects')
kwargs['dependencies'] = extract_as_list(kwargs, 'dependencies')
if 'extra_files' in kwargs:
ef = extract_as_list(kwargs, 'extra_files')
kwargs['extra_files'] = self.source_strings_to_files(ef)
kwargs['extra_files'] = self.source_strings_to_files(kwargs['extra_files'])
self.check_sources_exist(os.path.join(self.source_root, self.subdir), sources)
if targetclass not in {build.Executable, build.SharedLibrary, build.SharedModule, build.StaticLibrary, build.Jar}:
mlog.debug('Unknown target type:', str(targetclass))

@ -326,6 +326,7 @@ class _BaseBuildTarget(TypedDict):
"""
build_by_default: bool
extra_files: T.List[FileOrString]
install: bool
install_mode: FileMode
native: MachineChoice

@ -553,6 +553,7 @@ _JAVA_LANG_KW: KwargInfo[T.List[str]] = _BASE_LANG_KW.evolve(
_ALL_TARGET_KWS: T.List[KwargInfo] = [
OVERRIDE_OPTIONS_KW,
KwargInfo('build_by_default', bool, default=True, since='0.38.0'),
KwargInfo('extra_files', ContainerTypeInfo(list, (str, File)), default=[], listify=True),
INSTALL_KW,
INSTALL_MODE_KW,
NATIVE_KW,

Loading…
Cancel
Save