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/cmMakefile.cxx | |
parent | acf33ba191156c65682166f31a01e5d184b482ed (diff) | |
download | CMake-535acdc7a093c44c2d052247d0bfdb90e9c279a0.zip CMake-535acdc7a093c44c2d052247d0bfdb90e9c279a0.tar.gz CMake-535acdc7a093c44c2d052247d0bfdb90e9c279a0.tar.bz2 |
ENH: some performance optimizations
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3d3b2d1..d53f979 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -774,7 +774,9 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all, target.GetPostBuildCommands().push_back(cc); // Add the target to the set of targets. - this->Targets.insert(cmTargets::value_type(utilityName, target)); + cmTargets::iterator it = + this->Targets.insert(cmTargets::value_type(utilityName,target)).first; + this->LocalGenerator->GetGlobalGenerator()->AddTarget(*it); } void cmMakefile::AddDefineFlag(const char* flag) @@ -1152,7 +1154,9 @@ void cmMakefile::AddLibrary(const char* lname, int shared, target.GetSourceLists() = srcs; target.SetMakefile(this); this->AddGlobalLinkInformation(lname, target); - this->Targets.insert(cmTargets::value_type(lname,target)); + cmTargets::iterator it = + this->Targets.insert(cmTargets::value_type(lname,target)).first; + this->LocalGenerator->GetGlobalGenerator()->AddTarget(*it); } cmTarget* cmMakefile::AddExecutable(const char *exeName, @@ -1166,6 +1170,7 @@ cmTarget* cmMakefile::AddExecutable(const char *exeName, this->AddGlobalLinkInformation(exeName, target); cmTargets::iterator it = this->Targets.insert(cmTargets::value_type(exeName,target)).first; + this->LocalGenerator->GetGlobalGenerator()->AddTarget(*it); return &it->second; } @@ -2560,14 +2565,13 @@ bool cmMakefile::GetPropertyAsBool(const char* prop) const cmTarget* cmMakefile::FindTarget(const char* name) { cmTargets& tgts = this->GetTargets(); - for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) + + cmTargets::iterator i = tgts.find(name); + if (i == tgts.end()) { - if(l->first == name) - { - return &l->second; - } + return 0; } - return 0; + return &i->second; } cmTest* cmMakefile::CreateTest(const char* testName) |