Merge topic 'ninja-phony-rules-only-in-build-tree'

de8e534b Ninja: Limit custom command side-effects to build folder
This commit is contained in:
Brad King 2014-10-09 16:12:01 -04:00 committed by CMake Topic Stage
commit 4c02746372
1 changed files with 16 additions and 6 deletions

View File

@ -1042,17 +1042,27 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
std::back_inserter(unkownExplicitDepends)); std::back_inserter(unkownExplicitDepends));
std::string const rootBuildDirectory =
this->GetCMakeInstance()->GetHomeOutputDirectory();
for (std::vector<std::string>::const_iterator for (std::vector<std::string>::const_iterator
i = unkownExplicitDepends.begin(); i = unkownExplicitDepends.begin();
i != unkownExplicitDepends.end(); i != unkownExplicitDepends.end();
++i) ++i)
{ {
cmNinjaDeps deps(1,*i); //verify the file is in the build directory
this->WritePhonyBuild(os, std::string const absDepPath = cmSystemTools::CollapseFullPath(
"", i->c_str(), rootBuildDirectory.c_str());
deps, bool const inBuildDir = cmSystemTools::IsSubDirectory(absDepPath.c_str(),
deps); rootBuildDirectory.c_str());
} if(inBuildDir)
{
cmNinjaDeps deps(1,*i);
this->WritePhonyBuild(os,
"",
deps,
deps);
}
}
} }
void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os) void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)