diff options
author | Brad King <brad.king@kitware.com> | 2015-05-19 15:30:21 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-05-19 15:30:21 (GMT) |
commit | 594dd9b36a7f3ac37b56c89596ff38451570de3e (patch) | |
tree | 8950a435b89378220a624f8cf42e3883a05ff2ec /Source/cmGlobalGenerator.cxx | |
parent | 25d22be514436d8dfbcac0024b952bd059eeabc6 (diff) | |
parent | d7923b82ade9f84d0fc4c6d44b9719f2f7c0e9af (diff) | |
download | CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.zip CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.tar.gz CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.tar.bz2 |
Merge topic 'use-std-unordered_map'
d7923b82 Use std::unordered_map instead of hash_map where available.
820777af Tests: Don't rely on ordering of targets in maps.
921d74d8 AutoGen: Don't iterate over a container while populating it.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index cf9e6e6..1ca2c95 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1373,10 +1373,18 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens) { cmTargets& targets = this->LocalGenerators[i]->GetMakefile()->GetTargets(); + std::vector<std::string> targetNames; + targetNames.reserve(targets.size()); for(cmTargets::iterator ti = targets.begin(); ti != targets.end(); ++ti) { - cmTarget& target = ti->second; + targetNames.push_back(ti->second.GetName()); + } + for(std::vector<std::string>::iterator ti = targetNames.begin(); + ti != targetNames.end(); ++ti) + { + cmTarget& target = *this->LocalGenerators[i] + ->GetMakefile()->FindTarget(*ti, true); if(target.GetType() == cmTarget::EXECUTABLE || target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmTarget::SHARED_LIBRARY || |