diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-06-09 09:57:47 +0200 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-06-12 22:09:27 +0200 |
commit | 23f87e8157770c56d3aa568f3d1318f9b9070364 (patch) | |
tree | 89f980aa45d40f513a42d5cc0e39b48ede696f07 /Source/cmMessageCommand.cxx | |
parent | 54c65d5fb22c3cc53ecd707687c2f25b1643726b (diff) | |
download | cmake-23f87e8157770c56d3aa568f3d1318f9b9070364.tar.gz |
cmake: Remove force from IssueMessage API
The force parameter is ugly and makes the method harder to reason about
(issues the message ... but maybe it doesn't ... but then again you can
force it). It is a violation of
https://en.wikipedia.org/wiki/Interface_segregation_principle
and is the kind of thing described in a recent blog here:
http://code.joejag.com/2016/anti-if-the-missing-patterns.html
"Any time you see this you actually have two methods bundled into one.
That boolean represents an opportunity to name a concept in your code."
Diffstat (limited to 'Source/cmMessageCommand.cxx')
-rw-r--r-- | Source/cmMessageCommand.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index f4458a7dac..689e3fa8d7 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -63,8 +63,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); |