[Dependencies] Sort external file dependencies by more-stable order.

This commit is contained in:
Graydon Hoare
2017-03-28 16:34:02 -07:00
parent d018521464
commit 57b3947891
5 changed files with 37 additions and 15 deletions

View File

@@ -116,10 +116,11 @@ static bool emitMakeDependencies(DiagnosticEngine &diags,
out << escape(targetName) << " :";
// First include all other files in the module. Make-style dependencies
// need to be conservative!
for (StringRef path : opts.InputFilenames)
for (auto const &path : reversePathSortedFilenames(opts.InputFilenames))
out << ' ' << escape(path);
// Then print dependencies we've picked up during compilation.
for (StringRef path : depTracker.getDependencies())
for (auto const &path :
reversePathSortedFilenames(depTracker.getDependencies()))
out << ' ' << escape(path);
out << '\n';
});