diff options
author | Brad King <brad.king@kitware.com> | 2015-05-19 15:30:21 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-05-19 15:30:21 (GMT) |
commit | 594dd9b36a7f3ac37b56c89596ff38451570de3e (patch) | |
tree | 8950a435b89378220a624f8cf42e3883a05ff2ec /Source/cmGlobalGenerator.h | |
parent | 25d22be514436d8dfbcac0024b952bd059eeabc6 (diff) | |
parent | d7923b82ade9f84d0fc4c6d44b9719f2f7c0e9af (diff) | |
download | CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.zip CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.tar.gz CMake-594dd9b36a7f3ac37b56c89596ff38451570de3e.tar.bz2 |
Merge topic 'use-std-unordered_map'
d7923b82 Use std::unordered_map instead of hash_map where available.
820777af Tests: Don't rely on ordering of targets in maps.
921d74d8 AutoGen: Don't iterate over a container while populating it.
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r-- | Source/cmGlobalGenerator.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index c9bb9b4..f9ea449 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -24,7 +24,11 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmFileLockPool.h" -# include <cmsys/hash_map.hxx> +# ifdef CMake_HAVE_CXX11_UNORDERED_MAP +# include <unordered_map> +# else +# include <cmsys/hash_map.hxx> +# endif #endif class cmake; @@ -429,7 +433,11 @@ protected: // All targets in the entire project. #if defined(CMAKE_BUILD_WITH_CMAKE) +#ifdef CMake_HAVE_CXX11_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 |