From 2c426bfb2dbb0d00aee4eb68c53ddaa18d32bdaa Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 21 Jan 2014 13:18:40 -0500 Subject: Ninja: Normalize paths of CMake re-run rule dependencies Send all implicit dependencies through ConvertToNinjaPath. Add CMakeCache.txt before uniquifying the list. --- Source/cmGlobalNinjaGenerator.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 5e1f1ed..731bc00 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1110,16 +1110,24 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) /*restat=*/ false, /*generator=*/ true); + cmLocalNinjaGenerator *ng = static_cast(lg); + cmNinjaDeps implicitDeps; - for (std::vector::const_iterator i = - this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) { - const std::vector& lf = (*i)->GetMakefile()->GetListFiles(); - implicitDeps.insert(implicitDeps.end(), lf.begin(), lf.end()); - } + for(std::vector::const_iterator i = + this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) + { + std::vector const& lf = (*i)->GetMakefile()->GetListFiles(); + for(std::vector::const_iterator fi = lf.begin(); + fi != lf.end(); ++fi) + { + implicitDeps.push_back(ng->ConvertToNinjaPath(fi->c_str())); + } + } + implicitDeps.push_back("CMakeCache.txt"); + std::sort(implicitDeps.begin(), implicitDeps.end()); implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()), implicitDeps.end()); - implicitDeps.push_back("CMakeCache.txt"); this->WriteBuild(os, "Re-run CMake if any of its inputs changed.", -- cgit v0.12