summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-08 17:50:56 (GMT)
committerBrad King <brad.king@kitware.com>2016-02-08 18:08:11 (GMT)
commit9b7d5871b86036da009119e14f54d161f2d44f24 (patch)
treead8e06f9fe4d8f7e2b8c8f3a4f1adaea814ee3e5 /Source/cmGlobalGenerator.h
parent6cbf6a51976c9092f84ef4a90d35fb6fd60f5898 (diff)
downloadCMake-9b7d5871b86036da009119e14f54d161f2d44f24.zip
CMake-9b7d5871b86036da009119e14f54d161f2d44f24.tar.gz
CMake-9b7d5871b86036da009119e14f54d161f2d44f24.tar.bz2
Improve internal generator target structure lookup
In commit v3.5.0-rc1~272^2~6 (cmGlobalGenerator: Add FindGeneratorTarget API, 2015-10-25) a lookup was implemented via linear search. Replace it with an efficient data structure. Suggested-by: Stephen Kelly <steveire@gmail.com>
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r--Source/cmGlobalGenerator.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 82bb35c..48fa704 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -279,6 +279,7 @@ public:
bool needDisk = true);
void IndexTarget(cmTarget* t);
+ void IndexGeneratorTarget(cmGeneratorTarget* gt);
static bool IsReservedTarget(std::string const& name);
@@ -435,16 +436,21 @@ private:
#if defined(CMAKE_BUILD_WITH_CMAKE)
# ifdef CMake_HAVE_CXX11_UNORDERED_MAP
typedef std::unordered_map<std::string, cmTarget*> TargetMap;
+ typedef std::unordered_map<std::string, cmGeneratorTarget*>
+ GeneratorTargetMap;
# else
typedef cmsys::hash_map<std::string, cmTarget*> TargetMap;
+ typedef cmsys::hash_map<std::string, cmGeneratorTarget*> GeneratorTargetMap;
# endif
#else
typedef std::map<std::string,cmTarget *> TargetMap;
+ typedef std::map<std::string,cmGeneratorTarget *> GeneratorTargetMap;
#endif
// Map efficiently from target name to cmTarget instance.
// Do not use this structure for looping over all targets.
// It contains both normal and globally visible imported targets.
TargetMap TargetSearchIndex;
+ GeneratorTargetMap GeneratorTargetSearchIndex;
cmMakefile* TryCompileOuterMakefile;
// If you add a new map here, make sure it is copied