ada_args
Rules
ada_args
load("@rules_ada//ada/toolchains:args.bzl", "ada_args")
ada_args(name, data, actions, args, iterate_over, nested, requires_false, requires_none,
requires_not_none, requires_true)
Arguments an Ada toolchain passes to some of its actions.
Templates expand variables of the action ({output}, {objects}, ...) and
can be conditional on them; the toolchains documentation lists the variables
of each action. Order matters: an ada_toolchain emits its args in the
order given, after the tool and before the arguments of enabled features.
load("@rules_ada//ada/toolchains:defs.bzl", "LINK_ACTIONS", "ada_args")
ada_args(
name = "soname",
actions = ["link_shared_library"],
args = ["-Wl,-soname,{output_basename}"],
)
ada_args(
name = "rpaths",
actions = LINK_ACTIONS,
args = ["-Wl,-rpath,$ORIGIN/{runtime_library_search_directories}"],
iterate_over = "runtime_library_search_directories",
)
An ada_args target can be listed directly in ada_toolchain.args or
bundled with ada_args_list.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| data | Files the arguments refer to; added as inputs of every action the arguments apply to. | List of labels | optional | [] |
| actions | Actions the arguments apply to: compile, bind, archive, link_executable, link_shared_library. | List of strings | required | |
| args | Argument templates. {name} and {name.field} expand variables of the action; an argument that is exactly {name} for a list variable expands to one argument per element. {{ and }} are literal braces. Mutually exclusive with nested. | List of strings | optional | [] |
| iterate_over | A list variable; the node is expanded once per element, with the element bound to the same name. | String | optional | "" |
| nested | ada_nested_args expanded in order after args, for per-element conditions. | List of labels | optional | [] |
| requires_false | Expand only if this bool variable is False. | String | optional | "" |
| requires_none | Expand only if this variable is unset or an empty list. | String | optional | "" |
| requires_not_none | Expand only if this variable is set and, for lists, non-empty. | String | optional | "" |
| requires_true | Expand only if this bool variable is True. | String | optional | "" |