Factor out enum MessageType into dedicated header

Reduce the number of files relying on `cmake.h`.
This commit is contained in:
Bruno Manganelli
2018-11-22 03:36:50 +00:00
committed by Brad King
parent da566d4de8
commit cc2a5261f8
105 changed files with 698 additions and 610 deletions

View File

@@ -10,11 +10,11 @@
#include "cmCustomCommandLines.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
@@ -361,7 +361,7 @@ bool cmAddCustomCommandCommand::InitialPass(
} else {
bool issueMessage = true;
std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0050) << "\n";
@@ -372,7 +372,7 @@ bool cmAddCustomCommandCommand::InitialPass(
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
messageType = cmake::FATAL_ERROR;
messageType = MessageType::FATAL_ERROR;
break;
}
@@ -380,7 +380,7 @@ bool cmAddCustomCommandCommand::InitialPass(
e << "The SOURCE signatures of add_custom_command are no longer "
"supported.";
this->Makefile->IssueMessage(messageType, e.str());
if (messageType == cmake::FATAL_ERROR) {
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}