Do not crash when an imported target depends on a missing target
Commit e01cce28
(Allow add_dependencies() on imported targets,
2010-11-19) forgot to check if the dependee exists before using it.
This commit is contained in:
parent
e01cce2869
commit
8ee9bbbd0c
|
@ -276,9 +276,11 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
|
|||
for(std::set<cmStdString>::const_iterator i = utils.begin();
|
||||
i != utils.end(); ++i)
|
||||
{
|
||||
cmTarget* transitive_dependee =
|
||||
dependee->GetMakefile()->FindTargetToUse(i->c_str());
|
||||
this->AddTargetDepend(depender_index, transitive_dependee, false);
|
||||
if(cmTarget* transitive_dependee =
|
||||
dependee->GetMakefile()->FindTargetToUse(i->c_str()))
|
||||
{
|
||||
this->AddTargetDepend(depender_index, transitive_dependee, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue