From 4a6397a70c2b467b1285be4c0bae7533eb16f5e0 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 17 Jun 2013 11:25:39 -0400 Subject: [PATCH 1/2] Ninja: Track configured files so we can regenerate them. Unlike the Makefile generator the ninja generator did not tack any of its output files, so if they are deleted the generator would not run. --- Source/cmGlobalNinjaGenerator.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index fff972e58..e2c0e18a2 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -961,6 +961,9 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) { const std::vector& lf = (*i)->GetMakefile()->GetListFiles(); implicitDeps.insert(implicitDeps.end(), lf.begin(), lf.end()); + + const std::vector& of = (*i)->GetMakefile()->GetOutputFiles(); + implicitDeps.insert(implicitDeps.end(), of.begin(), of.end()); } std::sort(implicitDeps.begin(), implicitDeps.end()); implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()), From ad502502dfee281e5b0ad8ac57057d72220b4380 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 18 Jun 2013 13:50:54 -0400 Subject: [PATCH 2/2] cmMakefile: Track configured files so we can regenerate them (#13582) Currently when a configured file is removed from the build directory, running the build command will not regenerate the file. Now detect this and will rerun cmake properly when a user issues the build command. --- Source/cmMakefile.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d5d99a03a..f3a66bab8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3371,6 +3371,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, std::string sinfile = infile; this->AddCMakeDependFile(sinfile); cmSystemTools::ConvertToUnixSlashes(soutfile); + this->AddCMakeOutputFile(soutfile); mode_t perm = 0; cmSystemTools::GetPermissions(sinfile.c_str(), perm); std::string::size_type pos = soutfile.rfind('/');