From 7e36f34c66c9abdf921e492ab4d99cb500c0740f Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Fri, 26 Jan 2024 13:14:48 -0600 Subject: [PATCH] Document that alias_target accepts run_tgts since 0.60.0 This was accidentally changed in 982973f303e3d0431d9b79f89cdf2c8f1ee67bc0, when alias_target was changed to use typed_pos_args. --- docs/yaml/functions/alias_target.yaml | 4 +++- mesonbuild/interpreter/interpreter.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/yaml/functions/alias_target.yaml b/docs/yaml/functions/alias_target.yaml index 22ffdfd9881f..8bfeb95dc099 100644 --- a/docs/yaml/functions/alias_target.yaml +++ b/docs/yaml/functions/alias_target.yaml @@ -7,7 +7,9 @@ description: | you can run it as `meson compile target_name`. This is a dummy target that does not execute any command, but ensures that all dependencies are built. Dependencies can be any build target (e.g. return value of - [[executable]], [[custom_target]], etc) + [[executable]], [[custom_target]], etc). + + *(Since 0.60.0)* Also accepts [[run_tgt]] targets. posargs: target_name: diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index b736aea415ce..3771ca8ae83b 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -2124,6 +2124,8 @@ def func_run_target(self, node: mparser.FunctionNode, args: T.Tuple[str], def func_alias_target(self, node: mparser.BaseNode, args: T.Tuple[str, T.List[build.Target]], kwargs: 'TYPE_kwargs') -> build.AliasTarget: name, deps = args + if any(isinstance(d, build.RunTarget) for d in deps): + FeatureNew.single_use('Allow alias_target to comprise run_targets', '0.60.0', self.subproject) tg = build.AliasTarget(name, deps, self.subdir, self.subproject, self.environment) self.add_target(name, tg) return tg