diff options
author | Brad King <brad.king@kitware.com> | 2011-08-04 15:35:59 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-08-04 15:36:32 -0400 |
commit | 8ee9bbbd0ca5aab5bceb2dc9dda041e5745ffc19 (patch) | |
tree | 4ff0c6cb4b2f62eed78a7cfe3500705c1c9e6a93 /Source/cmComputeTargetDepends.cxx | |
parent | e01cce28694201342adc97825982ed66fc52af65 (diff) | |
download | cmake-8ee9bbbd0ca5aab5bceb2dc9dda041e5745ffc19.tar.gz |
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.
Diffstat (limited to 'Source/cmComputeTargetDepends.cxx')
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index a4ca363a87..3a0ed06406 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -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 |