diff options
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/backend/backends.py | 8 | ||||
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 8633f23..718f54c 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1135,6 +1135,8 @@ class Backend: for a in t.cmd_args: if isinstance(a, build.Target): depends.add(a) + elif isinstance(a, build.CustomTargetIndex): + depends.add(a.target) if isinstance(a, build.BuildTarget): extra_paths += self.determine_windows_extra_paths(a, []) @@ -1143,7 +1145,7 @@ class Backend: cmd_args.append(a) elif isinstance(a, str): cmd_args.append(a) - elif isinstance(a, build.Target): + elif isinstance(a, (build.Target, build.CustomTargetIndex)): cmd_args.extend(self.construct_target_rel_paths(a, t.workdir)) else: raise MesonException('Bad object in test command.') @@ -1161,7 +1163,7 @@ class Backend: def write_test_serialisation(self, tests: T.List['Test'], datafile: T.BinaryIO) -> None: pickle.dump(self.create_test_serialisation(tests), datafile) - def construct_target_rel_paths(self, t: build.Target, workdir: T.Optional[str]) -> T.List[str]: + def construct_target_rel_paths(self, t: T.Union[build.Target, build.CustomTargetIndex], workdir: T.Optional[str]) -> T.List[str]: target_dir = self.get_target_dir(t) # ensure that test executables can be run when passed as arguments if isinstance(t, build.Executable) and workdir is None: @@ -1170,7 +1172,7 @@ class Backend: if isinstance(t, build.BuildTarget): outputs = [t.get_filename()] else: - assert isinstance(t, build.CustomTarget) + assert isinstance(t, (build.CustomTarget, build.CustomTargetIndex)) outputs = t.get_outputs() outputs = [os.path.join(target_dir, x) for x in outputs] diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index ae6be3b..2a68aa0 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -199,7 +199,7 @@ known_build_target_kwargs = ( ) TEST_KWARGS: T.List[KwargInfo] = [ - KwargInfo('args', ContainerTypeInfo(list, (str, mesonlib.File, build.BuildTarget, build.CustomTarget)), + KwargInfo('args', ContainerTypeInfo(list, (str, mesonlib.File, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex)), listify=True, default=[]), KwargInfo('should_fail', bool, default=False), KwargInfo('timeout', int, default=30), |