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

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
ada_stdThe Ada standard library (adalib and adainclude).LabeloptionalNone
arThe archiver executable (ar or gcc-ar).LabeloptionalNone
bind_flagsAdditional flags for gnatbind.List of stringsoptional[]
binderThe gnatbind executable for elaboration ordering and consistency checking.LabeloptionalNone
compile_flagsAdditional compiler flags for Ada compilation.List of stringsoptional[]
compilerThe Ada compiler executable (gcc with GNAT support).LabeloptionalNone
compiler_idIdentifier for the Ada compiler. Currently only 'gnat' is supported.Stringoptional"gnat"
compiler_libGCC support files (backends, shared libs, runtime libs like libgcc.a, libatomic.a).LabeloptionalNone
gcovThe gcov executable for coverage support.LabeloptionalNone
link_flagsAdditional linker flags (e.g., -lgnat, -lgnarl).List of stringsoptional[]