Skip to main content

Module build_flags

Module build_flags 

Source
Expand description

Typed semantic build flags.

Cabin recognizes explicit, semantic build flags that compose across four layers, in this order (later layers override or append to earlier ones):

  1. Built-in backend defaults (today: the planner adds -std=c11 for C compiles and -std=c++17 for C++ compiles).
  2. Per-package general [profile] flags from the manifest.
  3. Per-package matching [target.'cfg(...)'.profile] flags.
  4. Workspace-root [profile.<name>] flags for the selected profile.

Manifest-declared fields are intentionally explicit: defines, include directories, C-only compile arguments, C++-only compile arguments, and link arguments. The C/C++ argv spaces stay separate all the way to the planner.

Structs§

ConditionalProfileFlags
Conditional [target.'cfg(...)'.profile] block. Same shape as ProfileFlags but tagged with the predicate that gates it.
ProfileFlags
Manifest-shape build-flag declaration. One per [profile] / [target.'cfg(...)'.profile] / [profile.<name>] table.
ProfileSettings
Per-package build-flags settings. Holds the unconditional [profile] table plus any [target.'cfg(...)'.profile] overrides declared in the same manifest.
ResolvedProfileFlags
Final, deterministic build-flag set fed to the planner.

Enums§

BuildFlagsValidationError
Errors produced while validating a manifest-side build-flags declaration.

Functions§

resolve_build_flags
Resolve build flags by merging the per-package and per-profile layers, in order.