pub struct CcDepfile {
pub files: Vec<PathBuf>,
}Expand description
A parsed GNU-style dependency list.
Fields§
§files: Vec<PathBuf>Prerequisite files named by the first rule.
Implementations§
Source§impl CcDepfile
impl CcDepfile
Sourcepub fn read(path: &Path) -> Result<Self, CcBypassReason>
pub fn read(path: &Path) -> Result<Self, CcBypassReason>
Read and parse the dependency list the compiler wrote.
Sourcepub fn read_for(
path: &Path,
family: CcCompilerFamily,
) -> Result<Self, CcBypassReason>
pub fn read_for( path: &Path, family: CcCompilerFamily, ) -> Result<Self, CcBypassReason>
Read the dependency output emitted by the selected compiler family.
Sourcepub fn read_msvc(path: &Path) -> Result<Self, CcBypassReason>
pub fn read_msvc(path: &Path) -> Result<Self, CcBypassReason>
Read MSVC’s /sourceDependencies JSON output.
Sourcepub fn parse(contents: &str) -> Result<Self, CcBypassReason>
pub fn parse(contents: &str) -> Result<Self, CcBypassReason>
Parse a GNU-style dependency list.
Only the first rule is read. The adapter never passes -MP, so a
well-formed file the adapter asked for has exactly one rule, and
anything further is ignored rather than guessed at.
Source§impl CcDepfile
impl CcDepfile
Sourcepub fn render(
targets: &[DepfileTarget],
files: &[PathBuf],
source: &Path,
phony_targets: bool,
) -> String
pub fn render( targets: &[DepfileTarget], files: &[PathBuf], source: &Path, phony_targets: bool, ) -> String
Render the dependency list a caller asked for, the way the driver
writes one: the rule’s targets, then every prerequisite on its own
continued line, then, for -MP, an empty rule per header so make does
not fail when one is deleted. source is the file that was compiled
and gets no phony rule, exactly as the driver leaves it out.
Escapes are the ones parse reads back: a space, a #, and a $ in
a path. A quoted target gets the same treatment; a literal one is
written as given, which is what -MT promises.