summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-04-30 19:40:39 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2014-05-07 19:48:32 (GMT)
commit325599caa2974f30d35f9ad0dbe1fc0760290b3e (patch)
treecda65fc2558c65435fefaad29434b5dfb5eb599f /Source
parentac4106c69abea254e6a887dd42997fcdaca3a001 (diff)
downloadCMake-325599caa2974f30d35f9ad0dbe1fc0760290b3e.zip
CMake-325599caa2974f30d35f9ad0dbe1fc0760290b3e.tar.gz
CMake-325599caa2974f30d35f9ad0dbe1fc0760290b3e.tar.bz2
cmGlobalGenerator: Store targets in hash maps
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx8
-rw-r--r--Source/cmGlobalGenerator.h15
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx2
4 files changed, 17 insertions, 10 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f09f7b3..4bdec3f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2070,15 +2070,13 @@ cmGlobalGenerator::FindTarget(const std::string& name,
{
if (!excludeAliases)
{
- std::map<std::string, cmTarget*>::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<std::string,cmTarget *>::const_iterator i =
- this->TotalTargets.find ( name );
+ TargetMap::const_iterator i = this->TotalTargets.find ( name );
if ( i != this->TotalTargets.end() )
{
return i->second;
@@ -2859,7 +2857,7 @@ void cmGlobalGenerator::WriteSummary()
cmGeneratedFileStream fout(fname.c_str());
// Generate summary information files for each target.
- for(std::map<std::string,cmTarget *>::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 82fb1e5..14ec99a 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 <cmsys/hash_map.hxx>
+#endif
+
class cmake;
class cmGeneratorTarget;
class cmGeneratorExpressionEvaluationFile;
@@ -389,9 +393,14 @@ protected:
cmTargetManifest TargetManifest;
// All targets in the entire project.
- std::map<std::string,cmTarget *> TotalTargets;
- std::map<std::string,cmTarget *> AliasTargets;
- std::map<std::string,cmTarget *> ImportedTargets;
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ typedef cmsys::hash_map<std::string, cmTarget*> TargetMap;
+#else
+ typedef std::map<std::string,cmTarget *> TargetMap;
+#endif
+ TargetMap TotalTargets;
+ TargetMap AliasTargets;
+ TargetMap ImportedTargets;
std::vector<cmGeneratorExpressionEvaluationFile*> EvaluationFiles;
virtual const char* GetPredefinedTargetsFolder();
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index e80df84..e6672a8 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<std::string,cmTarget *>::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 b3975b4..d44da37 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<std::string, cmTarget*>::const_iterator
+ for(TargetMap::const_iterator
ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
{
this->ForceLinkerLanguage(*ti->second);