diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-04-11 16:51:20 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-04-11 16:51:20 (GMT) |
commit | 535acdc7a093c44c2d052247d0bfdb90e9c279a0 (patch) | |
tree | 80d5ba7eb2fd31f5f5fe26bdf1c17f125b18229e /Source/cmGlobalGenerator.cxx | |
parent | acf33ba191156c65682166f31a01e5d184b482ed (diff) | |
download | CMake-535acdc7a093c44c2d052247d0bfdb90e9c279a0.zip CMake-535acdc7a093c44c2d052247d0bfdb90e9c279a0.tar.gz CMake-535acdc7a093c44c2d052247d0bfdb90e9c279a0.tar.bz2 |
ENH: some performance optimizations
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 57f2eb0..65bc4d5 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -584,7 +584,8 @@ void cmGlobalGenerator::Configure() // Setup relative path generation. this->ConfigureRelativePaths(); - + this->TotalTargets.clear(); + // start with this directory cmLocalGenerator *lg = this->CreateLocalGenerator(); this->LocalGenerators.push_back(lg); @@ -1019,17 +1020,28 @@ cmTarget* cmGlobalGenerator::FindTarget(const char* project, const char* name) { std::vector<cmLocalGenerator*>* gens = &this->LocalGenerators; + // if project specific if(project) { gens = &this->ProjectMap[project]; + for(unsigned int i = 0; i < gens->size(); ++i) + { + cmTarget* ret = (*gens)[i]->GetMakefile()->FindTarget(name); + if(ret) + { + return ret; + } + } } - for(unsigned int i = 0; i < gens->size(); ++i) + // if all projects/directories + else { - cmTarget* ret = (*gens)[i]->GetMakefile()->FindTarget(name); - if(ret) + std::map<cmStdString,cmTarget *>::iterator i = this->TotalTargets.find(name); + if (i == this->TotalTargets.end()) { - return ret; + return 0; } + return i->second; } return 0; } |