build: Fix annotations for CustomTarget

and fix a bug in the backend that the correct annotations uncover
pull/10473/head
Dylan Baker 3 years ago committed by Jussi Pakkanen
parent d0a0e04c98
commit f235b814c3
  1. 4
      mesonbuild/backend/backends.py
  2. 2
      mesonbuild/build.py

@ -1299,6 +1299,10 @@ class Backend:
elif isinstance(i, build.ExtractedObjects):
outputs = i.get_outputs(self)
fname = self.get_extracted_obj_paths(i.target, outputs)
elif isinstance(i, programs.ExternalProgram):
assert i.found(), "This shouldn't be possible"
assert i.path is not None, 'for mypy'
fname = [i.path]
else:
fname = [i.rel_to_builddir(self.build_to_src)]
if target.absolute_paths:

@ -2529,7 +2529,7 @@ class CustomTarget(Target, CommandBase):
def get_filename(self) -> str:
return self.outputs[0]
def get_sources(self) -> T.List[T.Union[str, File, 'CustomTarget', 'CustomTargetIndex', 'GeneratedList', 'ExtractedObjects']]:
def get_sources(self) -> T.List[T.Union[str, File, BuildTarget, GeneratedTypes, ExtractedObjects, programs.ExternalProgram]]:
return self.sources
def get_generated_lists(self) -> T.List[GeneratedList]:

Loading…
Cancel
Save