diff options
author | Pavel Solodovnikov <pa.solodovnikov@tensor.ru> | 2017-12-20 08:18:11 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <pa.solodovnikov@tensor.ru> | 2017-12-20 14:37:15 (GMT) |
commit | 66c0b36d75e16d4b62022b498df06440a843fdd6 (patch) | |
tree | 4021a8a4885e24058509aba569efae507e89837a | |
parent | b5bbf06c26260329855b26ecdea44027c3f0f598 (diff) | |
download | CMake-66c0b36d75e16d4b62022b498df06440a843fdd6.zip CMake-66c0b36d75e16d4b62022b498df06440a843fdd6.tar.gz CMake-66c0b36d75e16d4b62022b498df06440a843fdd6.tar.bz2 |
objlib: fix unchecked insertions in `cmGeneratorTarget::GetLanguages`
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 7 |
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); + } } } } |