From 46656aa1fa69b79aa0c645a131d7abfdc34e621c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 22 May 2015 00:35:21 +0200 Subject: cmake: Extract displayMessage method. --- Source/cmake.cxx | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 565db8b..15ea755 100644 --- a/Source/cmake.cxx +++ b/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) @@ -2547,6 +2529,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 cmake::GetDebugConfigs() { std::vector configs; -- cgit v0.12