Skip to content

Commit

Permalink
Document that alias_target accepts run_tgts since 0.60.0
Browse files Browse the repository at this point in the history
This was accidentally changed in
982973f, when alias_target was changed
to use typed_pos_args.
  • Loading branch information
tristan957 committed Jan 26, 2024
1 parent 760d8d5 commit 7e36f34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/yaml/functions/alias_target.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e36f34

Please sign in to comment.