diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 07cfe12e2..556bc9ba0 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3911,8 +3911,7 @@ cmTarget* cmMakefile::FindTarget(const std::string& name, { if (!excludeAliases) { - std::map::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::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 3bccb63e6..b4ee3b894 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -909,7 +909,12 @@ protected: // libraries, classes, and executables mutable cmTargets Targets; - std::map AliasTargets; +#if defined(CMAKE_BUILD_WITH_CMAKE) + typedef cmsys::hash_map TargetMap; +#else + typedef std::map TargetMap; +#endif + TargetMap AliasTargets; cmGeneratorTargetsType GeneratorTargets; std::vector SourceFiles; @@ -1010,7 +1015,7 @@ private: friend class cmMakefileCall; std::vector ImportedTargetsOwned; - std::map ImportedTargets; + TargetMap ImportedTargets; // Internal policy stack management. void PushPolicy(bool weak = false,