mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
Make C++ feature checks extensible
Turn the feature check for cxx11_unordered_map into a function such that we can use it for other features as well. Drop the 11 suffix, as we may want to check features from other standards.
This commit is contained in:
committed by
Brad King
parent
68bb74d9e6
commit
ea5477e43d
@@ -13,7 +13,7 @@
|
||||
|
||||
// Use a hash table to avoid duplicate file time checks from disk.
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
|
||||
#ifdef CMake_HAVE_CXX_UNORDERED_MAP
|
||||
#include <unordered_map>
|
||||
#else
|
||||
#include <cmsys/hash_map.hxx>
|
||||
@@ -47,13 +47,13 @@ private:
|
||||
{
|
||||
public:
|
||||
size_t operator()(const std::string& s) const { return h(s.c_str()); }
|
||||
#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
|
||||
#ifdef CMake_HAVE_CXX_UNORDERED_MAP
|
||||
std::hash<const char*> h;
|
||||
#else
|
||||
cmsys::hash<const char*> h;
|
||||
#endif
|
||||
};
|
||||
#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
|
||||
#ifdef CMake_HAVE_CXX_UNORDERED_MAP
|
||||
typedef std::unordered_map<std::string,
|
||||
#else
|
||||
typedef cmsys::hash_map<std::string,
|
||||
|
||||
Reference in New Issue
Block a user