mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
This commit is contained in:
committed by
Brad King
parent
da566d4de8
commit
cc2a5261f8
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "cmGlobalGenerator.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmMessageType.h"
|
||||
#include "cmPolicies.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmake.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
|
||||
@@ -58,7 +58,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
|
||||
}
|
||||
|
||||
if (fname.empty()) {
|
||||
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
|
||||
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING,
|
||||
"include() given empty file name (ignored).");
|
||||
return true;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
|
||||
if (gg->IsExportedTargetsFile(fname_abs)) {
|
||||
const char* modal = nullptr;
|
||||
std::ostringstream e;
|
||||
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
|
||||
MessageType messageType = MessageType::AUTHOR_WARNING;
|
||||
|
||||
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0024)) {
|
||||
case cmPolicies::WARN:
|
||||
@@ -92,7 +92,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
case cmPolicies::NEW:
|
||||
modal = "may";
|
||||
messageType = cmake::FATAL_ERROR;
|
||||
messageType = MessageType::FATAL_ERROR;
|
||||
}
|
||||
if (modal) {
|
||||
e << "The file\n " << fname_abs
|
||||
@@ -103,7 +103,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
|
||||
"include() command. Use ALIAS targets instead to refer to targets "
|
||||
"by alternative names.\n";
|
||||
this->Makefile->IssueMessage(messageType, e.str());
|
||||
if (messageType == cmake::FATAL_ERROR) {
|
||||
if (messageType == MessageType::FATAL_ERROR) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user