diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-21 22:31:52 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-21 22:54:26 (GMT) |
commit | ca7cc2ebd0bd17b70279a51a3a087b5629175f06 (patch) | |
tree | fe489e8995902175b24cb7869f3c6e461884af3f /Source/cmake.cxx | |
parent | fa752bf3393e583851b333cc41d2507dc217e9a8 (diff) | |
download | CMake-ca7cc2ebd0bd17b70279a51a3a087b5629175f06.zip CMake-ca7cc2ebd0bd17b70279a51a3a087b5629175f06.tar.gz CMake-ca7cc2ebd0bd17b70279a51a3a087b5629175f06.tar.bz2 |
cmake: Extract PrintMessagePreamble method.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index fe727cd..29f84df 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2436,14 +2436,8 @@ static bool cmakeCheckStampList(const char* stampList) return true; } -//---------------------------------------------------------------------------- -void cmake::IssueMessage(cmake::MessageType t, std::string const& text, - cmListFileBacktrace const& bt) +bool cmake::PrintMessagePreamble(cmake::MessageType t, std::ostream& msg) { - cmListFileBacktrace backtrace = bt; - backtrace.MakeRelative(); - - std::ostringstream msg; // Construct the message header. if(t == cmake::FATAL_ERROR) { @@ -2475,11 +2469,26 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); if(suppress && cmSystemTools::IsOn(suppress)) { - return; + return false; } msg << " (dev)"; } } + return true; +} + +//---------------------------------------------------------------------------- +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); |