From e0f740f1b1708ac4ec43a57b8f1cbc549afe5df3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 10 Oct 2015 15:03:41 +0200 Subject: [PATCH] Always cache entries through the cmake instance. --- Source/cmMakefile.cxx | 4 ++-- Source/cmMarkAsAdvancedCommand.cxx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c06050557..7866c6bbb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1908,13 +1908,13 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, nvalue += files[cc]; } - this->GetState()->AddCacheEntry(name, nvalue.c_str(), doc, type); + this->GetCMakeInstance()->AddCacheEntry(name, nvalue.c_str(), doc, type); val = this->GetState()->GetInitializedCacheValue(name); haveVal = true; } } - this->GetState()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + this->GetCMakeInstance()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc, type); // if there was a definition then remove it this->StateSnapshot.RemoveDefinition(name); diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 10d30f31f..8d0e2b3a4 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -39,7 +39,8 @@ bool cmMarkAsAdvancedCommand cmState* state = this->Makefile->GetState(); if (!state->GetCacheEntryValue(variable)) { - state->AddCacheEntry(variable, 0, 0, cmState::UNINITIALIZED); + this->Makefile->GetCMakeInstance()->AddCacheEntry( + variable, 0, 0, cmState::UNINITIALIZED); overwrite = true; } if (!state->GetCacheEntryValue(variable))