Merge "Keep only out file dependency rule in output .d files"

This commit is contained in:
Chih-hung Hsieh 2020-09-02 05:39:36 +00:00 committed by Gerrit Code Review
commit 21928dbbdd
1 changed files with 6 additions and 1 deletions

View File

@ -31,9 +31,14 @@ var (
Command: "$envVars $rustcCmd " +
"-C linker=${config.RustLinker} " +
"-C link-args=\"${crtBegin} ${config.RustLinkerArgs} ${linkFlags} ${crtEnd}\" " +
"--emit link -o $out --emit dep-info=$out.d $in ${libFlags} $rustcFlags",
"--emit link -o $out --emit dep-info=$out.d.raw $in ${libFlags} $rustcFlags" +
" && grep \"^$out:\" $out.d.raw > $out.d",
CommandDeps: []string{"$rustcCmd"},
// Rustc deps-info writes out make compatible dep files: https://github.com/rust-lang/rust/issues/7633
// Rustc emits unneeded dependency lines for the .d and input .rs files.
// Those extra lines cause ninja warning:
// "warning: depfile has multiple output paths"
// For ninja, we keep/grep only the dependency rule for the rust $out file.
Deps: blueprint.DepsGCC,
Depfile: "$out.d",
},