backend/backends: Fix type assertions in backend

Test dependencies can be of type CustomTargetIndex,
similar to other targets.
pull/13421/head
Andreas Kässens 5 months ago committed by Dylan Baker
parent 4172cbd0fb
commit f5d66b4932
  1. 6
      mesonbuild/backend/backends.py

@ -1171,7 +1171,7 @@ class Backend:
def determine_windows_extra_paths(
self, target: T.Union[build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, programs.ExternalProgram, mesonlib.File, str],
extra_bdeps: T.Sequence[T.Union[build.BuildTarget, build.CustomTarget]]) -> T.List[str]:
extra_bdeps: T.Sequence[T.Union[build.BuildTarget, build.CustomTarget, build.CustomTargetIndex]]) -> T.List[str]:
"""On Windows there is no such thing as an rpath.
We must determine all locations of DLLs that this exe
@ -1231,7 +1231,7 @@ class Backend:
exe_wrapper = self.environment.get_exe_wrapper()
machine = self.environment.machines[exe.for_machine]
if machine.is_windows() or machine.is_cygwin():
extra_bdeps: T.List[T.Union[build.BuildTarget, build.CustomTarget]] = []
extra_bdeps: T.List[T.Union[build.BuildTarget, build.CustomTarget, build.CustomTargetIndex]] = []
if isinstance(exe, build.CustomTarget):
extra_bdeps = list(exe.get_transitive_build_target_deps())
extra_paths = self.determine_windows_extra_paths(exe, extra_bdeps)
@ -1428,7 +1428,7 @@ class Backend:
continue
result[arg.get_id()] = arg
for dep in t.depends:
assert isinstance(dep, (build.CustomTarget, build.BuildTarget))
assert isinstance(dep, (build.CustomTarget, build.BuildTarget, build.CustomTargetIndex))
result[dep.get_id()] = dep
return result

Loading…
Cancel
Save