Merge topic 'objlib-dedup'

66c0b36d objlib: fix unchecked insertions in `cmGeneratorTarget::GetLanguages`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1609
This commit is contained in:
Brad King
2017-12-21 12:58:42 +00:00
committed by Kitware Robot

View File

@@ -5133,7 +5133,12 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
std::string objLib = extObj->GetObjectLibrary();
if (cmGeneratorTarget* tgt =
this->LocalGenerator->FindGeneratorTargetToUse(objLib)) {
objectLibraries.push_back(tgt);
auto const objLibIt =
std::find_if(objectLibraries.cbegin(), objectLibraries.cend(),
[tgt](cmGeneratorTarget* t) { return t == tgt; });
if (objectLibraries.cend() == objLibIt) {
objectLibraries.push_back(tgt);
}
}
}
}