diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-06-04 10:14:37 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-06-04 16:11:19 (GMT) |
commit | 537ea119b9d65d8723b6df8a7ba71f29466c0f63 (patch) | |
tree | c5cf00807dbf37177ead90d0a2fadef976f1a4dc | |
parent | c4826787d50d02a8e403b99b589a35875e7d7f23 (diff) | |
download | CMake-537ea119b9d65d8723b6df8a7ba71f29466c0f63.zip CMake-537ea119b9d65d8723b6df8a7ba71f29466c0f63.tar.gz CMake-537ea119b9d65d8723b6df8a7ba71f29466c0f63.tar.bz2 |
cmTarget: Initialize static std::unordered_set on construction
-rw-r--r-- | Source/cmTarget.cxx | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6351189..b10b30f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1491,7 +1491,6 @@ const char* cmTarget::GetComputedProperty( const char* cmTarget::GetProperty(const std::string& prop) const { - static std::unordered_set<std::string> specialProps; #define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP MAKE_STATIC_PROP(LINK_LIBRARIES); MAKE_STATIC_PROP(TYPE); @@ -1509,23 +1508,23 @@ const char* cmTarget::GetProperty(const std::string& prop) const MAKE_STATIC_PROP(SOURCE_DIR); MAKE_STATIC_PROP(SOURCES); #undef MAKE_STATIC_PROP - if (specialProps.empty()) { - specialProps.insert(propLINK_LIBRARIES); - specialProps.insert(propTYPE); - specialProps.insert(propINCLUDE_DIRECTORIES); - specialProps.insert(propCOMPILE_FEATURES); - specialProps.insert(propCOMPILE_OPTIONS); - specialProps.insert(propCOMPILE_DEFINITIONS); - specialProps.insert(propLINK_OPTIONS); - specialProps.insert(propLINK_DIRECTORIES); - specialProps.insert(propIMPORTED); - specialProps.insert(propIMPORTED_GLOBAL); - specialProps.insert(propMANUALLY_ADDED_DEPENDENCIES); - specialProps.insert(propNAME); - specialProps.insert(propBINARY_DIR); - specialProps.insert(propSOURCE_DIR); - specialProps.insert(propSOURCES); - } + static std::unordered_set<std::string> const specialProps{ + propLINK_LIBRARIES, + propTYPE, + propINCLUDE_DIRECTORIES, + propCOMPILE_FEATURES, + propCOMPILE_OPTIONS, + propCOMPILE_DEFINITIONS, + propLINK_OPTIONS, + propLINK_DIRECTORIES, + propIMPORTED, + propIMPORTED_GLOBAL, + propMANUALLY_ADDED_DEPENDENCIES, + propNAME, + propBINARY_DIR, + propSOURCE_DIR, + propSOURCES + }; if (specialProps.count(prop)) { if (prop == propLINK_LIBRARIES) { if (impl->LinkImplementationPropertyEntries.empty()) { |