From 04377f1b318020ef0c9fef099842f26290d19324 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Fri, 13 Jun 2014 12:11:06 +0200 Subject: [PATCH] Ninja: Remove CMake includes from explicit depends (#14972) It may happen that CMake include is an explicit dependency for some command, while all CMake includes are set phony in WriteTargetRebuildManifest, this may lead to duplicate phony generate rules which causes ninja warnings. We need to remove implicit CMake includes in WriteUnknownExplicitDependencies. This fixes FindCUDA ninja warnings. --- Source/cmGlobalNinjaGenerator.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 731bc00c0..60643acc4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -972,7 +972,16 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) { knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); } + //get list files which are implicit dependencies as well and will be phony + //for rebuild manifest + std::vector const& lf = (*i)->GetMakefile()->GetListFiles(); + typedef std::vector::const_iterator vect_it; + for(vect_it j = lf.begin(); j != lf.end(); ++j) + { + knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); + } } + knownDependencies.insert( "CMakeCache.txt" ); for(std::vector::const_iterator li = this->EvaluationFiles.begin();