Forráskód Böngészése

cmake: Extract displayMessage method.

Stephen Kelly 10 éve
szülő
commit
46656aa1fa
1 módosított fájl, 25 hozzáadás és 19 törlés
  1. 25 19
      Source/cmake.cxx

+ 25 - 19
Source/cmake.cxx

@@ -2485,26 +2485,8 @@ void printMessageText(std::ostream& msg, std::string const& text)
    formatter.PrintFormatted(msg, text.c_str());
 }
 
-//----------------------------------------------------------------------------
-void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
-                         cmListFileBacktrace const& bt)
+void displayMessage(cmake::MessageType t, std::ostringstream& msg)
 {
-  cmListFileBacktrace backtrace = bt;
-  backtrace.MakeRelative();
-
-  std::ostringstream msg;
-  if (!this->PrintMessagePreamble(t, msg))
-    {
-    return;
-    }
-
-  // Add the immediate context.
-  backtrace.PrintTitle(msg);
-
-  printMessageText(msg, text);
-
-  // Add the rest of the context.
-  backtrace.PrintCallStack(msg);
 
   // Add a note about warning suppression.
   if(t == cmake::AUTHOR_WARNING)
@@ -2546,6 +2528,30 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
     }
 }
 
+//----------------------------------------------------------------------------
+void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
+                         cmListFileBacktrace const& bt)
+{
+  cmListFileBacktrace backtrace = bt;
+  backtrace.MakeRelative();
+
+  std::ostringstream msg;
+  if (!this->PrintMessagePreamble(t, msg))
+    {
+    return;
+    }
+
+  // Add the immediate context.
+  backtrace.PrintTitle(msg);
+
+  printMessageText(msg, text);
+
+  // Add the rest of the context.
+  backtrace.PrintCallStack(msg);
+
+  displayMessage(t, msg);
+}
+
 //----------------------------------------------------------------------------
 std::vector<std::string> cmake::GetDebugConfigs()
 {