Merge topic 'fix-cmake-ISP-violation'
23f87e81
cmake: Remove force from IssueMessage API54c65d5f
cmake: Extract DisplayMessage API.
This commit is contained in:
commit
4e66ca1952
|
@ -105,8 +105,8 @@ cmMakefile::~cmMakefile()
|
||||||
cmDeleteAll(this->EvaluationFiles);
|
cmDeleteAll(this->EvaluationFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text,
|
void cmMakefile::IssueMessage(cmake::MessageType t,
|
||||||
bool force) const
|
std::string const& text) const
|
||||||
{
|
{
|
||||||
// Collect context information.
|
// Collect context information.
|
||||||
if (!this->ExecutionStatusStack.empty()) {
|
if (!this->ExecutionStatusStack.empty()) {
|
||||||
|
@ -114,7 +114,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text,
|
||||||
this->ExecutionStatusStack.back()->SetNestedError(true);
|
this->ExecutionStatusStack.back()->SetNestedError(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace(), force);
|
this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
|
||||||
}
|
}
|
||||||
|
|
||||||
cmStringRange cmMakefile::GetIncludeDirectoriesEntries() const
|
cmStringRange cmMakefile::GetIncludeDirectoriesEntries() const
|
||||||
|
|
|
@ -720,8 +720,7 @@ public:
|
||||||
cmMakefile* Makefile;
|
cmMakefile* Makefile;
|
||||||
};
|
};
|
||||||
|
|
||||||
void IssueMessage(cmake::MessageType t, std::string const& text,
|
void IssueMessage(cmake::MessageType t, std::string const& text) const;
|
||||||
bool force = false) const;
|
|
||||||
|
|
||||||
/** Set whether or not to report a CMP0000 violation. */
|
/** Set whether or not to report a CMP0000 violation. */
|
||||||
void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
|
void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
|
||||||
|
|
|
@ -64,8 +64,9 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
|
||||||
std::string message = cmJoin(cmMakeRange(i, args.end()), std::string());
|
std::string message = cmJoin(cmMakeRange(i, args.end()), std::string());
|
||||||
|
|
||||||
if (type != cmake::MESSAGE) {
|
if (type != cmake::MESSAGE) {
|
||||||
// we've overriden the message type, above, so force IssueMessage to use it
|
// we've overriden the message type, above, so display it directly
|
||||||
this->Makefile->IssueMessage(type, message, true);
|
cmake* cm = this->Makefile->GetCMakeInstance();
|
||||||
|
cm->DisplayMessage(type, message, this->Makefile->GetBacktrace());
|
||||||
} else {
|
} else {
|
||||||
if (status) {
|
if (status) {
|
||||||
this->Makefile->DisplayStatus(message.c_str(), -1);
|
this->Makefile->DisplayStatus(message.c_str(), -1);
|
||||||
|
|
|
@ -2294,22 +2294,26 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
|
void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
|
||||||
cmListFileBacktrace const& backtrace,
|
cmListFileBacktrace const& backtrace) const
|
||||||
bool force) const
|
|
||||||
{
|
{
|
||||||
if (!force) {
|
bool force = false;
|
||||||
// override the message type, if needed, for warnings and errors
|
// override the message type, if needed, for warnings and errors
|
||||||
cmake::MessageType override = this->ConvertMessageType(t);
|
cmake::MessageType override = this->ConvertMessageType(t);
|
||||||
if (override != t) {
|
if (override != t) {
|
||||||
t = override;
|
t = override;
|
||||||
force = true;
|
force = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!force && !this->IsMessageTypeVisible(t)) {
|
if (!force && !this->IsMessageTypeVisible(t)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->DisplayMessage(t, text, backtrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cmake::DisplayMessage(cmake::MessageType t, std::string const& text,
|
||||||
|
cmListFileBacktrace const& backtrace) const
|
||||||
|
{
|
||||||
std::ostringstream msg;
|
std::ostringstream msg;
|
||||||
if (!printMessagePreamble(t, msg)) {
|
if (!printMessagePreamble(t, msg)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -381,8 +381,10 @@ public:
|
||||||
/** Display a message to the user. */
|
/** Display a message to the user. */
|
||||||
void IssueMessage(
|
void IssueMessage(
|
||||||
cmake::MessageType t, std::string const& text,
|
cmake::MessageType t, std::string const& text,
|
||||||
cmListFileBacktrace const& backtrace = cmListFileBacktrace(),
|
cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const;
|
||||||
bool force = false) const;
|
|
||||||
|
void DisplayMessage(cmake::MessageType t, std::string const& text,
|
||||||
|
cmListFileBacktrace const& backtrace) const;
|
||||||
|
|
||||||
///! run the --build option
|
///! run the --build option
|
||||||
int Build(const std::string& dir, const std::string& target,
|
int Build(const std::string& dir, const std::string& target,
|
||||||
|
|
Loading…
Reference in New Issue