diff options
author | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-11-22 00:49:50 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-01-01 00:55:08 (GMT) |
commit | 8a803d784bf65d2c8556eb1e6b6134b878e89c79 (patch) | |
tree | 75b091d837b3eacdd7de3ec2b8e59d5cd71636d0 /Source/cmake.cxx | |
parent | 99a224e3ee0b6a770c388313a7b32746a95514e8 (diff) | |
download | CMake-8a803d784bf65d2c8556eb1e6b6134b878e89c79.zip CMake-8a803d784bf65d2c8556eb1e6b6134b878e89c79.tar.gz CMake-8a803d784bf65d2c8556eb1e6b6134b878e89c79.tar.bz2 |
cmMessenger: Decouple from cmState
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2ac7f4d..181522f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -140,7 +140,7 @@ cmake::cmake(Role role) this->State = new cmState; this->CurrentSnapshot = this->State->CreateBaseSnapshot(); - this->Messenger = new cmMessenger(this->State); + this->Messenger = new cmMessenger; #ifdef __APPLE__ struct rlimit rlp; @@ -1299,6 +1299,23 @@ int cmake::Configure() } } + // Cache variables may have already been set by a previous invocation, + // so we cannot rely on command line options alone. Always ensure our + // messenger is in sync with the cache. + const char* value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED"); + this->Messenger->SetSuppressDeprecatedWarnings(value && + cmSystemTools::IsOff(value)); + + value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED"); + this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value)); + + value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value)); + + value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS"); + this->Messenger->SetDevWarningsAsErrors(value && + cmSystemTools::IsOff(value)); + int ret = this->ActualConfigure(); const char* delCacheVars = this->State->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); @@ -1691,6 +1708,18 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, this->State->AddCacheEntry(key, value, helpString, cmStateEnums::CacheEntryType(type)); this->UnwatchUnusedCli(key); + + if (key == "CMAKE_WARN_DEPRECATED") { + this->Messenger->SetSuppressDeprecatedWarnings( + value && cmSystemTools::IsOff(value)); + } else if (key == "CMAKE_ERROR_DEPRECATED") { + this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value)); + } else if (key == "CMAKE_SUPPRESS_DEVELOPER_WARNINGS") { + this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value)); + } else if (key == "CMAKE_SUPPRESS_DEVELOPER_ERRORS") { + this->Messenger->SetDevWarningsAsErrors(value && + cmSystemTools::IsOff(value)); + } } bool cmake::DoWriteGlobVerifyTarget() const |