summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-10-21 21:52:51 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-24 13:58:52 (GMT)
commit1a74e719068c97518d6f9521c86862a17166f32e (patch)
tree2f45312d552f2cc383871fff6ef1cd0cef847151 /Source/cmMakefile.h
parent1e555a44aa4e3d40bca2f88915c9f957098e5a55 (diff)
downloadCMake-1a74e719068c97518d6f9521c86862a17166f32e.zip
CMake-1a74e719068c97518d6f9521c86862a17166f32e.tar.gz
CMake-1a74e719068c97518d6f9521c86862a17166f32e.tar.bz2
Introduce CM_UNORDERED_MAP
Avoid duplicating switch among std::unordered_map, cmsys::hash_map, and std::map.
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h31
1 files changed, 4 insertions, 27 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index b61e81b..3067f2c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -12,6 +12,7 @@
#include "cmStateSnapshot.h"
#include "cmTarget.h"
#include "cmTargetLinkLibraryType.h"
+#include "cm_unordered_map.hxx"
#include "cmake.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -27,14 +28,6 @@
#include <string>
#include <vector>
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-#ifdef CMake_HAVE_CXX_UNORDERED_MAP
-#include <unordered_map>
-#else
-#include <cmsys/hash_map.hxx>
-#endif
-#endif
-
class cmCommand;
class cmCompiledGeneratorExpression;
class cmCustomCommandLines;
@@ -783,15 +776,6 @@ protected:
// libraries, classes, and executables
mutable cmTargets Targets;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-#ifdef CMake_HAVE_CXX_UNORDERED_MAP
- typedef std::unordered_map<std::string, cmTarget*> TargetMap;
-#else
- typedef cmsys::hash_map<std::string, cmTarget*> TargetMap;
-#endif
-#else
- typedef std::map<std::string, cmTarget*> TargetMap;
-#endif
std::map<std::string, std::string> AliasTargets;
std::vector<cmSourceFile*> SourceFiles;
@@ -863,6 +847,7 @@ private:
friend class cmParseFileScope;
std::vector<cmTarget*> ImportedTargetsOwned;
+ typedef CM_UNORDERED_MAP<std::string, cmTarget*> TargetMap;
TargetMap ImportedTargets;
// Internal policy stack management.
@@ -899,16 +884,8 @@ private:
*/
cmSourceFile* LinearGetSourceFileWithOutput(const std::string& cname) const;
-// A map for fast output to input look up.
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-#ifdef CMake_HAVE_CXX_UNORDERED_MAP
- typedef std::unordered_map<std::string, cmSourceFile*> OutputToSourceMap;
-#else
- typedef cmsys::hash_map<std::string, cmSourceFile*> OutputToSourceMap;
-#endif
-#else
- typedef std::map<std::string, cmSourceFile*> OutputToSourceMap;
-#endif
+ // A map for fast output to input look up.
+ typedef CM_UNORDERED_MAP<std::string, cmSourceFile*> OutputToSourceMap;
OutputToSourceMap OutputToSource;
void UpdateOutputToSourceMap(std::vector<std::string> const& outputs,