diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-04-30 17:27:33 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2014-05-07 19:48:32 (GMT) |
commit | ac4106c69abea254e6a887dd42997fcdaca3a001 (patch) | |
tree | 0bc010811e15d9577d55348a24c1e7d253ac8cb5 | |
parent | 94429287454a3b40268dd48db7b38f158bbecd93 (diff) | |
download | CMake-ac4106c69abea254e6a887dd42997fcdaca3a001.zip CMake-ac4106c69abea254e6a887dd42997fcdaca3a001.tar.gz CMake-ac4106c69abea254e6a887dd42997fcdaca3a001.tar.bz2 |
cmMakefile: Use a hashmap for imported targets
-rw-r--r-- | Source/cmMakefile.cxx | 5 | ||||
-rw-r--r-- | Source/cmMakefile.h | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 07cfe12..556bc9b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3911,8 +3911,7 @@ cmTarget* cmMakefile::FindTarget(const std::string& name, { if (!excludeAliases) { - std::map<std::string, cmTarget*>::const_iterator i - = this->AliasTargets.find(name); + TargetMap::const_iterator i = this->AliasTargets.find(name); if (i != this->AliasTargets.end()) { return i->second; @@ -4134,7 +4133,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name, { // Look for an imported target. These take priority because they // are more local in scope and do not have to be globally unique. - std::map<std::string, cmTarget*>::const_iterator + TargetMap::const_iterator imported = this->ImportedTargets.find(name); if(imported != this->ImportedTargets.end()) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 3bccb63..b4ee3b8 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -909,7 +909,12 @@ protected: // libraries, classes, and executables mutable cmTargets Targets; - std::map<std::string, cmTarget*> AliasTargets; +#if defined(CMAKE_BUILD_WITH_CMAKE) + typedef cmsys::hash_map<std::string, cmTarget*> TargetMap; +#else + typedef std::map<std::string, cmTarget*> TargetMap; +#endif + TargetMap AliasTargets; cmGeneratorTargetsType GeneratorTargets; std::vector<cmSourceFile*> SourceFiles; @@ -1010,7 +1015,7 @@ private: friend class cmMakefileCall; std::vector<cmTarget*> ImportedTargetsOwned; - std::map<std::string, cmTarget*> ImportedTargets; + TargetMap ImportedTargets; // Internal policy stack management. void PushPolicy(bool weak = false, |