summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-01-02 20:28:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-01-02 20:31:39 (GMT)
commit124a8632cbdb88be8e9768a83ddb63790d5bf60f (patch)
tree67e5fe33c183be06b2fa3477308204ff69421d57 /Source/cmake.cxx
parent88f1e79f3e8076bd57d9ae54037fd05f655c2960 (diff)
parent8a803d784bf65d2c8556eb1e6b6134b878e89c79 (diff)
downloadCMake-124a8632cbdb88be8e9768a83ddb63790d5bf60f.zip
CMake-124a8632cbdb88be8e9768a83ddb63790d5bf60f.tar.gz
CMake-124a8632cbdb88be8e9768a83ddb63790d5bf60f.tar.bz2
Merge topic 'messenger-no-cmstate-v2'
8a803d784b cmMessenger: Decouple from cmState Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2653
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx31
1 files changed, 30 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e81d14b..1bc36cc 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -141,7 +141,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;
@@ -1300,6 +1300,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_");
@@ -1701,6 +1718,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