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:
Daniel Pfeifer
2016-06-23 00:16:15 +02:00
committed by Brad King
parent 68bb74d9e6
commit ea5477e43d
10 changed files with 50 additions and 39 deletions

View File

@@ -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,