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

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
dataFiles the arguments refer to; added as inputs of every action the arguments apply to.List of labelsoptional[]
actionsActions the arguments apply to: compile, bind, archive, link_executable, link_shared_library.List of stringsrequired
argsArgument 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 stringsoptional[]
iterate_overA list variable; the node is expanded once per element, with the element bound to the same name.Stringoptional""
nestedada_nested_args expanded in order after args, for per-element conditions.List of labelsoptional[]
requires_falseExpand only if this bool variable is False.Stringoptional""
requires_noneExpand only if this variable is unset or an empty list.Stringoptional""
requires_not_noneExpand only if this variable is set and, for lists, non-empty.Stringoptional""
requires_trueExpand only if this bool variable is True.Stringoptional""