Commit f1bdfdf2 authored by Sebastian Holtermann's avatar Sebastian Holtermann

cmAddCustomCommand: Initialize static std::unordered_set on construction

parent 8af4b31b
...@@ -95,30 +95,29 @@ bool cmAddCustomCommandCommand::InitialPass( ...@@ -95,30 +95,29 @@ bool cmAddCustomCommandCommand::InitialPass(
MAKE_STATIC_KEYWORD(VERBATIM); MAKE_STATIC_KEYWORD(VERBATIM);
MAKE_STATIC_KEYWORD(WORKING_DIRECTORY); MAKE_STATIC_KEYWORD(WORKING_DIRECTORY);
#undef MAKE_STATIC_KEYWORD #undef MAKE_STATIC_KEYWORD
static std::unordered_set<std::string> keywords; static std::unordered_set<std::string> const keywords{
if (keywords.empty()) { keyAPPEND,
keywords.insert(keyAPPEND); keyARGS,
keywords.insert(keyARGS); keyBYPRODUCTS,
keywords.insert(keyBYPRODUCTS); keyCOMMAND,
keywords.insert(keyCOMMAND); keyCOMMAND_EXPAND_LISTS,
keywords.insert(keyCOMMAND_EXPAND_LISTS); keyCOMMENT,
keywords.insert(keyCOMMENT); keyDEPENDS,
keywords.insert(keyDEPENDS); keyDEPFILE,
keywords.insert(keyDEPFILE); keyIMPLICIT_DEPENDS,
keywords.insert(keyIMPLICIT_DEPENDS); keyJOB_POOL,
keywords.insert(keyJOB_POOL); keyMAIN_DEPENDENCY,
keywords.insert(keyMAIN_DEPENDENCY); keyOUTPUT,
keywords.insert(keyOUTPUT); keyOUTPUTS,
keywords.insert(keyOUTPUTS); keyPOST_BUILD,
keywords.insert(keyPOST_BUILD); keyPRE_BUILD,
keywords.insert(keyPRE_BUILD); keyPRE_LINK,
keywords.insert(keyPRE_LINK); keySOURCE,
keywords.insert(keySOURCE); keyTARGET,
keywords.insert(keyTARGET); keyUSES_TERMINAL,
keywords.insert(keyUSES_TERMINAL); keyVERBATIM,
keywords.insert(keyVERBATIM); keyWORKING_DIRECTORY
keywords.insert(keyWORKING_DIRECTORY); };
}
for (std::string const& copy : args) { for (std::string const& copy : args) {
if (keywords.count(copy)) { if (keywords.count(copy)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment