[Cmake-commits] CMake branch, master, updated. v3.13.2-791-g124a863

Kitware Robot kwrobot at kitware.com
Wed Jan 2 15:33:05 EST 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  124a8632cbdb88be8e9768a83ddb63790d5bf60f (commit)
       via  8a803d784bf65d2c8556eb1e6b6134b878e89c79 (commit)
      from  88f1e79f3e8076bd57d9ae54037fd05f655c2960 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=124a8632cbdb88be8e9768a83ddb63790d5bf60f
commit 124a8632cbdb88be8e9768a83ddb63790d5bf60f
Merge: 88f1e79 8a803d7
Author:     Craig Scott <craig.scott at crascit.com>
AuthorDate: Wed Jan 2 20:28:14 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Jan 2 15:31:39 2019 -0500

    Merge topic 'messenger-no-cmstate-v2'
    
    8a803d784b cmMessenger: Decouple from cmState
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2653


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a803d784bf65d2c8556eb1e6b6134b878e89c79
commit 8a803d784bf65d2c8556eb1e6b6134b878e89c79
Author:     Bruno Manganelli <bruno.manga95 at gmail.com>
AuthorDate: Thu Nov 22 00:49:50 2018 +0000
Commit:     Craig Scott <craig.scott at crascit.com>
CommitDate: Tue Jan 1 11:55:08 2019 +1100

    cmMessenger: Decouple from cmState

diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx
index a81428a..880cf4b 100644
--- a/Source/cmMessenger.cxx
+++ b/Source/cmMessenger.cxx
@@ -4,7 +4,6 @@
 
 #include "cmAlgorithms.h"
 #include "cmDocumentationFormatter.h"
-#include "cmState.h"
 #include "cmSystemTools.h"
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -131,11 +130,6 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg)
   }
 }
 
-cmMessenger::cmMessenger(cmState* state)
-  : State(state)
-{
-}
-
 void cmMessenger::IssueMessage(cmake::MessageType t, const std::string& text,
                                const cmListFileBacktrace& backtrace) const
 {
@@ -173,31 +167,3 @@ void cmMessenger::DisplayMessage(cmake::MessageType t, const std::string& text,
 
   displayMessage(t, msg);
 }
-
-bool cmMessenger::GetSuppressDevWarnings() const
-{
-  const char* cacheEntryValue =
-    this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
-  return cmSystemTools::IsOn(cacheEntryValue);
-}
-
-bool cmMessenger::GetSuppressDeprecatedWarnings() const
-{
-  const char* cacheEntryValue =
-    this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
-  return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue);
-}
-
-bool cmMessenger::GetDevWarningsAsErrors() const
-{
-  const char* cacheEntryValue =
-    this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS");
-  return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue);
-}
-
-bool cmMessenger::GetDeprecatedWarningsAsErrors() const
-{
-  const char* cacheEntryValue =
-    this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
-  return cmSystemTools::IsOn(cacheEntryValue);
-}
diff --git a/Source/cmMessenger.h b/Source/cmMessenger.h
index 4aafbd4..e947eaa 100644
--- a/Source/cmMessenger.h
+++ b/Source/cmMessenger.h
@@ -10,13 +10,9 @@
 
 #include <string>
 
-class cmState;
-
 class cmMessenger
 {
 public:
-  cmMessenger(cmState* state);
-
   void IssueMessage(
     cmake::MessageType t, std::string const& text,
     cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const;
@@ -24,16 +20,42 @@ public:
   void DisplayMessage(cmake::MessageType t, std::string const& text,
                       cmListFileBacktrace const& backtrace) const;
 
-  bool GetSuppressDevWarnings() const;
-  bool GetSuppressDeprecatedWarnings() const;
-  bool GetDevWarningsAsErrors() const;
-  bool GetDeprecatedWarningsAsErrors() const;
+  void SetSuppressDevWarnings(bool suppress)
+  {
+    this->SuppressDevWarnings = suppress;
+  }
+  void SetSuppressDeprecatedWarnings(bool suppress)
+  {
+    this->SuppressDeprecatedWarnings = suppress;
+  }
+  void SetDevWarningsAsErrors(bool error)
+  {
+    this->DevWarningsAsErrors = error;
+  }
+  void SetDeprecatedWarningsAsErrors(bool error)
+  {
+    this->DeprecatedWarningsAsErrors = error;
+  }
+
+  bool GetSuppressDevWarnings() const { return this->SuppressDevWarnings; }
+  bool GetSuppressDeprecatedWarnings() const
+  {
+    return this->SuppressDeprecatedWarnings;
+  }
+  bool GetDevWarningsAsErrors() const { return this->DevWarningsAsErrors; }
+  bool GetDeprecatedWarningsAsErrors() const
+  {
+    return this->DeprecatedWarningsAsErrors;
+  }
 
 private:
   bool IsMessageTypeVisible(cmake::MessageType t) const;
   cmake::MessageType ConvertMessageType(cmake::MessageType t) const;
 
-  cmState* State;
+  bool SuppressDevWarnings = false;
+  bool SuppressDeprecatedWarnings = false;
+  bool DevWarningsAsErrors = false;
+  bool DeprecatedWarningsAsErrors = false;
 };
 
 #endif
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

-----------------------------------------------------------------------

Summary of changes:
 Source/cmMessenger.cxx | 34 ----------------------------------
 Source/cmMessenger.h   | 40 +++++++++++++++++++++++++++++++---------
 Source/cmake.cxx       | 31 ++++++++++++++++++++++++++++++-
 3 files changed, 61 insertions(+), 44 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list