Expand description
Compiler-dialect drivers for Cabin’s build backend.
Cabin’s planner (cabin_build)
produces a toolchain-independent semantic IR — a list of
BuildActions describing what to compile, archive, and link,
with no compiler flags spelled out. This crate is the single
boundary where that intent becomes a concrete command line.
A Dialect names a compiler command-line family. Two are
supported:
Dialect::GnuLike— the GCC / Clang driver (-std=c++17,-O2,-D/-I/-c/-o,-MMD -MFdepfiles).Dialect::Msvc— the Microsoftcl.exe/lib.exedriver (/std:c++17,/O2,/D//I//c//Fo,/showIncludesdependency tracking).
The dialect owns every platform- and toolchain-specific
decision: how artifacts are named (Dialect::object_extension,
Dialect::static_library_name, Dialect::executable_name),
how Ninja discovers header dependencies (Dialect::ninja_deps),
and how each BuildAction is spelled (lower()). The planner
and the Ninja writer stay dialect-agnostic: they ask the dialect.
This split mirrors the way LLVM’s clang Driver constructs
per-toolchain jobs and the way rustc selects a LinkerFlavor:
one abstract description, many concrete spellings. Everything
here is pure, deterministic, and free of I/O, so both dialects
are fully unit-testable on any host.
Re-exports§
pub use action::ArchiveAction;pub use action::BuildAction;pub use action::CompileAction;pub use action::CompileArguments;pub use action::CompileMode;pub use action::LinkAction;pub use dialect::Dialect;pub use dialect::NinjaDeps;pub use lower::LoweredAction;pub use lower::LoweredActionKind;pub use lower::compile_argv;pub use lower::lower;
Modules§
- action
- Semantic build-action IR.
- dialect
- Compiler command-line dialects and their artifact conventions.
- lower
- Lower the semantic
BuildActionIR into concrete command argv for aDialect.