diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1c48d39d3..2a30593cc 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2085,15 +2085,13 @@ cmGlobalGenerator::FindTarget(const std::string& name, { if (!excludeAliases) { - std::map::const_iterator ai - = this->AliasTargets.find(name); + TargetMap::const_iterator ai = this->AliasTargets.find(name); if (ai != this->AliasTargets.end()) { return ai->second; } } - std::map::const_iterator i = - this->TotalTargets.find ( name ); + TargetMap::const_iterator i = this->TotalTargets.find ( name ); if ( i != this->TotalTargets.end() ) { return i->second; @@ -2874,7 +2872,7 @@ void cmGlobalGenerator::WriteSummary() cmGeneratedFileStream fout(fname.c_str()); // Generate summary information files for each target. - for(std::map::const_iterator ti = + for(TargetMap::const_iterator ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti) { if ((ti->second)->GetType() == cmTarget::INTERFACE_LIBRARY) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 82fb1e597..14ec99a9f 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -22,6 +22,10 @@ #include "cmGeneratorTarget.h" #include "cmGeneratorExpression.h" +#if defined(CMAKE_BUILD_WITH_CMAKE) +# include +#endif + class cmake; class cmGeneratorTarget; class cmGeneratorExpressionEvaluationFile; @@ -389,9 +393,14 @@ protected: cmTargetManifest TargetManifest; // All targets in the entire project. - std::map TotalTargets; - std::map AliasTargets; - std::map ImportedTargets; +#if defined(CMAKE_BUILD_WITH_CMAKE) + typedef cmsys::hash_map TargetMap; +#else + typedef std::map TargetMap; +#endif + TargetMap TotalTargets; + TargetMap AliasTargets; + TargetMap ImportedTargets; std::vector EvaluationFiles; virtual const char* GetPredefinedTargetsFolder(); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index e80df845d..e6672a816 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -341,7 +341,7 @@ void cmGlobalVisualStudio8Generator::Generate() if(this->AddCheckTarget()) { // All targets depend on the build-system check target. - for(std::map::const_iterator + for(TargetMap::const_iterator ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti) { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b3975b48a..d44da3794 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1219,7 +1219,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, void cmGlobalXCodeGenerator::ForceLinkerLanguages() { // This makes sure all targets link using the proper language. - for(std::map::const_iterator + for(TargetMap::const_iterator ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti) { this->ForceLinkerLanguage(*ti->second); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9ad637ad7..801627a55 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3858,8 +3858,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; @@ -4081,7 +4080,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,