Merge topic 'ninja-phony-rules-only-in-build-tree'
de8e534b
Ninja: Limit custom command side-effects to build folder
This commit is contained in:
commit
4c02746372
|
@ -1042,11 +1042,20 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
|
|||
std::back_inserter(unkownExplicitDepends));
|
||||
|
||||
|
||||
std::string const rootBuildDirectory =
|
||||
this->GetCMakeInstance()->GetHomeOutputDirectory();
|
||||
for (std::vector<std::string>::const_iterator
|
||||
i = unkownExplicitDepends.begin();
|
||||
i != unkownExplicitDepends.end();
|
||||
++i)
|
||||
{
|
||||
//verify the file is in the build directory
|
||||
std::string const absDepPath = cmSystemTools::CollapseFullPath(
|
||||
i->c_str(), rootBuildDirectory.c_str());
|
||||
bool const inBuildDir = cmSystemTools::IsSubDirectory(absDepPath.c_str(),
|
||||
rootBuildDirectory.c_str());
|
||||
if(inBuildDir)
|
||||
{
|
||||
cmNinjaDeps deps(1,*i);
|
||||
this->WritePhonyBuild(os,
|
||||
"",
|
||||
|
@ -1054,6 +1063,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
|
|||
deps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue