Expand description
Read-side ingestion of the conventional C/C++ build-flag
environment variables: CPPFLAGS, CFLAGS, CXXFLAGS, and
LDFLAGS.
Cabin reads each variable at command start, parses its value
into argv tokens using POSIX shell-style word splitting via
the shlex crate, and surfaces the result as a typed
EnvBuildFlags. The orchestration layer is responsible for
merging the parsed flags into the per-package
cabin_core::ResolvedProfileFlags map; this module owns the
parsing, error wording, and variable attribution only.
Crate boundaries (matching the rest of cabin-env):
- this module never invokes a shell, reads files, or touches the filesystem;
- it never depends on
cabin-build,cabin-core, or any higher-level crate; - it consumes a
Fn(&str) -> Option<OsString>env-lookup closure so tests can pump fixture values through without mutating the process environment.
Structs§
- EnvBuild
Flags - Typed view of the four conventional C/C++ build-flag environment variables, already shell-split into argv tokens.
Enums§
- EnvBuild
Flags Error - Reason a
parse_env_build_flagscall failed. Both variants name the offending variable so the diagnostic is actionable.
Constants§
- CFLAGS
CFLAGS— flags applied only to C compile commands. Appended to each primary package’scflagsbucket. Never reaches a C++ compile line.- CPPFLAGS
CPPFLAGS— preprocessor flags applied to both C/C++ compile commands. Cabin appends parsed tokens to each primary package’s language-neutralextra_compile_argsbucket, after profile / manifest / dependency / pkg-config flags.- CXXFLAGS
CXXFLAGS— flags applied only to C++ compile commands. Appended to each primary package’scxxflagsbucket. Never reaches a C compile line.- LDFLAGS
LDFLAGS— flags applied only to link commands. Appended to each primary package’sldflagsbucket. Never reaches a compile command.
Functions§
- parse_
env_ build_ flags - Read
CPPFLAGS,CFLAGS,CXXFLAGS, andLDFLAGSthrough the supplied env-lookup closure, parse each value using POSIX shell-style word splitting (viashlex::split), and return the typed view.