Merge topic 'fix-cache-self-assignment'

1cd37527 cmCacheManager: Avoid cache entry self-assignment
326d15a3 cmake: Tolerate missing HELPSTRING on compiler change
This commit is contained in:
Brad King 2014-05-28 12:34:30 -04:00 committed by CMake Topic Stage
commit af34639724
2 changed files with 5 additions and 6 deletions

View File

@ -751,11 +751,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key,
}
e.SetProperty("HELPSTRING", helpString? helpString :
"(This variable does not exist and should not be used)");
if (this->Cache[key].Value == e.Value)
{
this->CMakeInstance->UnwatchUnusedCli(key);
}
this->Cache[key] = e;
this->CMakeInstance->UnwatchUnusedCli(key);
}
bool cmCacheManager::CacheIterator::IsAtEnd() const

View File

@ -1236,7 +1236,10 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
if(ci.Find(save.key))
{
save.type = ci.GetType();
save.help = ci.GetProperty("HELPSTRING");
if(const char* help = ci.GetProperty("HELPSTRING"))
{
save.help = help;
}
}
saved.push_back(save);
}