ada_library

Rules

ada_library

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

ada_library(name, deps, srcs, data, compile_data, copts, exports_bodies, linkopts, subunits)

Compiles Ada source files into a library. This is the primary rule for Ada-to-Ada dependencies and cross-language interop via CcInfo. Use ada_static_library or ada_shared_library when you need to produce a specific artifact type for external consumption.

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[]
exports_bodiesIf True, this library's body sources flow into downstream compile inputs. Set this on libraries whose public API exposes generics, since cross-unit generic instantiation requires the generic body at the instantiation site's compile time.BooleanoptionalFalse
linkoptsAdditional linker flags.List of stringsoptional[]
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[]