diff options
author | Brad King <brad.king@kitware.com> | 2016-06-13 13:54:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-06-13 13:54:27 (GMT) |
commit | 4e66ca1952c0ba9dfba6050f83f67c90884c8492 (patch) | |
tree | ba64a2020360c326489b43e422a1edf55489880b /Source | |
parent | 18e00ac7b918865c38a2e34ee584e18c1126c663 (diff) | |
parent | 23f87e8157770c56d3aa568f3d1318f9b9070364 (diff) | |
download | CMake-4e66ca1952c0ba9dfba6050f83f67c90884c8492.zip CMake-4e66ca1952c0ba9dfba6050f83f67c90884c8492.tar.gz CMake-4e66ca1952c0ba9dfba6050f83f67c90884c8492.tar.bz2 |
Merge topic 'fix-cmake-ISP-violation'
23f87e81 cmake: Remove force from IssueMessage API
54c65d5f cmake: Extract DisplayMessage API.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefile.h | 3 | ||||
-rw-r--r-- | Source/cmMessageCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmake.cxx | 22 | ||||
-rw-r--r-- | Source/cmake.h | 6 |
5 files changed, 24 insertions, 18 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c72c95c..c9192fd 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -105,8 +105,8 @@ cmMakefile::~cmMakefile() cmDeleteAll(this->EvaluationFiles); } -void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text, - bool force) const +void cmMakefile::IssueMessage(cmake::MessageType t, + std::string const& text) const { // Collect context information. if (!this->ExecutionStatusStack.empty()) { @@ -114,7 +114,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text, this->ExecutionStatusStack.back()->SetNestedError(true); } } - this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace(), force); + this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace()); } cmStringRange cmMakefile::GetIncludeDirectoriesEntries() const diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 81c3f71..1680c6a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -720,8 +720,7 @@ public: cmMakefile* Makefile; }; - void IssueMessage(cmake::MessageType t, std::string const& text, - bool force = false) const; + void IssueMessage(cmake::MessageType t, std::string const& text) const; /** Set whether or not to report a CMP0000 violation. */ void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; } diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index dab90c9..080880b 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -64,8 +64,9 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args, std::string message = cmJoin(cmMakeRange(i, args.end()), std::string()); if (type != cmake::MESSAGE) { - // we've overriden the message type, above, so force IssueMessage to use it - this->Makefile->IssueMessage(type, message, true); + // we've overriden the message type, above, so display it directly + cmake* cm = this->Makefile->GetCMakeInstance(); + cm->DisplayMessage(type, message, this->Makefile->GetBacktrace()); } else { if (status) { this->Makefile->DisplayStatus(message.c_str(), -1); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 98ac518..e404fa3 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2294,22 +2294,26 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg) } void cmake::IssueMessage(cmake::MessageType t, std::string const& text, - cmListFileBacktrace const& backtrace, - bool force) const + cmListFileBacktrace const& backtrace) const { - if (!force) { - // override the message type, if needed, for warnings and errors - cmake::MessageType override = this->ConvertMessageType(t); - if (override != t) { - t = override; - force = true; - } + bool force = false; + // override the message type, if needed, for warnings and errors + cmake::MessageType override = this->ConvertMessageType(t); + if (override != t) { + t = override; + force = true; } if (!force && !this->IsMessageTypeVisible(t)) { return; } + this->DisplayMessage(t, text, backtrace); +} + +void cmake::DisplayMessage(cmake::MessageType t, std::string const& text, + cmListFileBacktrace const& backtrace) const +{ std::ostringstream msg; if (!printMessagePreamble(t, msg)) { return; diff --git a/Source/cmake.h b/Source/cmake.h index aa1ff2c..b1e2448 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -381,8 +381,10 @@ public: /** Display a message to the user. */ void IssueMessage( cmake::MessageType t, std::string const& text, - cmListFileBacktrace const& backtrace = cmListFileBacktrace(), - bool force = false) const; + cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const; + + void DisplayMessage(cmake::MessageType t, std::string const& text, + cmListFileBacktrace const& backtrace) const; ///! run the --build option int Build(const std::string& dir, const std::string& target, |