summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Solodovnikov <pa.solodovnikov@tensor.ru>2017-12-20 08:18:11 (GMT)
committerPavel Solodovnikov <pa.solodovnikov@tensor.ru>2017-12-20 14:37:15 (GMT)
commit66c0b36d75e16d4b62022b498df06440a843fdd6 (patch)
tree4021a8a4885e24058509aba569efae507e89837a
parentb5bbf06c26260329855b26ecdea44027c3f0f598 (diff)
downloadCMake-66c0b36d75e16d4b62022b498df06440a843fdd6.zip
CMake-66c0b36d75e16d4b62022b498df06440a843fdd6.tar.gz
CMake-66c0b36d75e16d4b62022b498df06440a843fdd6.tar.bz2
objlib: fix unchecked insertions in `cmGeneratorTarget::GetLanguages`
-rw-r--r--Source/cmGeneratorTarget.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 103d034..2cf53cc 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -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);
+ }
}
}
}