ada_binary

Rules

ada_binary

load("@rules_ada//ada:ada_binary.bzl", "ada_binary")

ada_binary(name, deps, srcs, data, compile_data, copts, linkopts, linkstatic, main, subunits)

Compiles Ada source files, binds them, and links into an executable.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
depsDependencies. Can be Ada targets (AdaInfo) or C/C++ targets (CcInfo).List of labelsoptional[]
srcsAda source files (.ads specs and .adb bodies).List of labelsoptional[]
dataAdditional files needed at runtime.List of labelsoptional[]
compile_dataAdditional Ada source files needed during compilation but not compiled independently (e.g., subunit bodies referenced via 'separate').List of labelsoptional[]
coptsAdditional compiler flags for Ada compilation (e.g., -gnatwa, -O2).List of stringsoptional[]
linkoptsAdditional linker flags.List of stringsoptional[]
linkstaticPrefer static linking for dependencies. Like cc_binary, this also selects the static_linking_mode feature; False (or --dynamic_mode=fully) selects dynamic_linking_mode instead.BooleanoptionalTrue
mainMain Ada source file containing the entry point procedure. It is compiled even if it is not listed in srcs. If not set, the first .adb file in srcs is used.LabeloptionalNone
subunitsBody files that are separate subunits, listed explicitly to bypass the hyphen-stem heuristic. Files listed here MUST also appear in srcs. They flow as inputs to their parent unit's compile but get no standalone compile action.List of labelsoptional[]