ada_toolchain
Rules
ada_toolchain
load("@rules_ada//ada:ada_toolchain.bzl", "ada_toolchain")
ada_toolchain(name, ada_std, ar, bind_flags, binder, compile_flags, compiler, compiler_id,
compiler_lib, gcov, link_flags)
Defines an Ada toolchain providing the GNAT compiler (gcc), binder (gnatbind), archiver (ar), and compilation/linking flags.
Example:
load("@rules_ada//ada:ada_toolchain.bzl", "ada_toolchain")
ada_toolchain(
name = "gnat_toolchain",
compiler = "@gnat//:bin/gcc",
binder = "@gnat//:bin/gnatbind",
ar = "@gnat//:bin/ar",
ada_std = "@gnat//:ada_std",
compiler_lib = "@gnat//:compiler_lib",
gcov = "@gnat//:bin/gcov",
compile_flags = ["-O2"],
link_flags = ["-lgnat"],
)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| ada_std | The Ada standard library (adalib and adainclude). | Label | optional | None |
| ar | The archiver executable (ar or gcc-ar). | Label | optional | None |
| bind_flags | Additional flags for gnatbind. | List of strings | optional | [] |
| binder | The gnatbind executable for elaboration ordering and consistency checking. | Label | optional | None |
| compile_flags | Additional compiler flags for Ada compilation. | List of strings | optional | [] |
| compiler | The Ada compiler executable (gcc with GNAT support). | Label | optional | None |
| compiler_id | Identifier for the Ada compiler. Currently only 'gnat' is supported. | String | optional | "gnat" |
| compiler_lib | GCC support files (backends, shared libs, runtime libs like libgcc.a, libatomic.a). | Label | optional | None |
| gcov | The gcov executable for coverage support. | Label | optional | None |
| link_flags | Additional linker flags (e.g., -lgnat, -lgnarl). | List of strings | optional | [] |