1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-22 07:25:02 +08:00

Autogen: cmQtAutoMocUic settings hash computation optimizations

This commit is contained in:
Sebastian Holtermann
2019-08-26 18:36:18 +02:00
parent b66cd3fe63
commit 32b15d320f

View File

@@ -1912,22 +1912,19 @@ void cmQtAutoMocUic::SettingsFileRead()
// Compose current settings strings // Compose current settings strings
{ {
cmCryptoHash cryptoHash(cmCryptoHash::AlgoSHA256); cmCryptoHash cryptoHash(cmCryptoHash::AlgoSHA256);
std::string const sep(";"); auto cha = [&cryptoHash](cm::string_view value) {
auto cha = [&cryptoHash, &sep](std::string const& value) {
cryptoHash.Append(value); cryptoHash.Append(value);
cryptoHash.Append(sep); cryptoHash.Append(";");
}; };
if (MocConst_.Enabled) { if (MocConst_.Enabled) {
cryptoHash.Initialize(); cryptoHash.Initialize();
cha(MocConst().Executable); cha(MocConst().Executable);
for (auto const& value : MocConst().AllOptions) { std::for_each(MocConst().AllOptions.begin(), MocConst().AllOptions.end(),
cha(value); cha);
}
cha(BaseConst().IncludeProjectDirsBefore ? "TRUE" : "FALSE"); cha(BaseConst().IncludeProjectDirsBefore ? "TRUE" : "FALSE");
for (auto const& value : MocConst().PredefsCmd) { std::for_each(MocConst().PredefsCmd.begin(), MocConst().PredefsCmd.end(),
cha(value); cha);
}
for (auto const& filter : MocConst().DependFilters) { for (auto const& filter : MocConst().DependFilters) {
cha(filter.Key); cha(filter.Key);
} }
@@ -1940,14 +1937,11 @@ void cmQtAutoMocUic::SettingsFileRead()
if (UicConst().Enabled) { if (UicConst().Enabled) {
cryptoHash.Initialize(); cryptoHash.Initialize();
cha(UicConst().Executable); cha(UicConst().Executable);
for (auto const& value : UicConst().TargetOptions) { std::for_each(UicConst().TargetOptions.begin(),
cha(value); UicConst().TargetOptions.end(), cha);
}
for (const auto& item : UicConst().Options) { for (const auto& item : UicConst().Options) {
cha(item.first); cha(item.first);
for (auto const& svalue : item.second) { std::for_each(item.second.begin(), item.second.end(), cha);
cha(svalue);
}
} }
SettingsStringUic_ = cryptoHash.FinalizeHex(); SettingsStringUic_ = cryptoHash.FinalizeHex();
} }