Introduce CM_UNORDERED_SET

Avoid duplicating switch among std::unordered_set, cmsys::hash_set, and
std::set.
This commit is contained in:
Daniel Pfeifer
2016-10-24 22:33:18 +02:00
parent f660832999
commit c15dc19728
4 changed files with 51 additions and 49 deletions
+2 -11
View File
@@ -10,16 +10,7 @@
#include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
#include "cmTarget.h"
#if defined(CMake_HAVE_CXX_UNORDERED_SET)
#include <unordered_set>
#define UNORDERED_SET std::unordered_set
#elif defined(CMAKE_BUILD_WITH_CMAKE)
#include <cmsys/hash_set.hxx>
#define UNORDERED_SET cmsys::hash_set
#else
#define UNORDERED_SET std::set
#endif
#include "cm_unordered_set.hxx"
bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
std::string const& tgtName, cmMessenger* messenger,
@@ -59,7 +50,7 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty(
if (cmHasLiteralPrefix(prop, "INTERFACE_")) {
return true;
}
static UNORDERED_SET<std::string> builtIns;
static CM_UNORDERED_SET<std::string> builtIns;
if (builtIns.empty()) {
builtIns.insert("COMPATIBLE_INTERFACE_BOOL");
builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MAX");