diff options
author | Brad King <brad.king@kitware.com> | 2017-12-21 12:58:42 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-12-21 12:58:48 (GMT) |
commit | 228468cf3e1c600e49a581a59e9f998be2c03f11 (patch) | |
tree | 662e06210bf7861837bb7e207710fdbf56e8e96b | |
parent | 70fba77b2614a064640a6e8f68803a3b349740ea (diff) | |
parent | 66c0b36d75e16d4b62022b498df06440a843fdd6 (diff) | |
download | CMake-228468cf3e1c600e49a581a59e9f998be2c03f11.zip CMake-228468cf3e1c600e49a581a59e9f998be2c03f11.tar.gz CMake-228468cf3e1c600e49a581a59e9f998be2c03f11.tar.bz2 |
Merge topic 'objlib-dedup'
66c0b36d objlib: fix unchecked insertions in `cmGeneratorTarget::GetLanguages`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1609
-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); + } } } } |