diff options
author | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-11-22 03:36:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-16 13:16:31 (GMT) |
commit | cc2a5261f82c21e15899bba0d9b508fcacda7879 (patch) | |
tree | 38d9e0113178cd43c7f42898392452b6a8e8e84a /Source/cmBreakCommand.cxx | |
parent | da566d4de885130e182edc80f13691f5ca24bb61 (diff) | |
download | CMake-cc2a5261f82c21e15899bba0d9b508fcacda7879.zip CMake-cc2a5261f82c21e15899bba0d9b508fcacda7879.tar.gz CMake-cc2a5261f82c21e15899bba0d9b508fcacda7879.tar.bz2 |
Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
Diffstat (limited to 'Source/cmBreakCommand.cxx')
-rw-r--r-- | Source/cmBreakCommand.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmBreakCommand.cxx b/Source/cmBreakCommand.cxx index 3772c6f..d07898f 100644 --- a/Source/cmBreakCommand.cxx +++ b/Source/cmBreakCommand.cxx @@ -6,8 +6,8 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" +#include "cmMessageType.h" #include "cmPolicies.h" -#include "cmake.h" // cmBreakCommand bool cmBreakCommand::InitialPass(std::vector<std::string> const& args, @@ -16,7 +16,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args, if (!this->Makefile->IsLoopBlock()) { bool issueMessage = true; std::ostringstream e; - cmake::MessageType messageType = cmake::AUTHOR_WARNING; + MessageType messageType = MessageType::AUTHOR_WARNING; switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { case cmPolicies::WARN: e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n"; @@ -27,7 +27,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args, case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::REQUIRED_IF_USED: case cmPolicies::NEW: - messageType = cmake::FATAL_ERROR; + messageType = MessageType::FATAL_ERROR; break; } @@ -35,7 +35,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args, e << "A BREAK command was found outside of a proper " "FOREACH or WHILE loop scope."; this->Makefile->IssueMessage(messageType, e.str()); - if (messageType == cmake::FATAL_ERROR) { + if (messageType == MessageType::FATAL_ERROR) { return false; } } @@ -46,7 +46,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args, if (!args.empty()) { bool issueMessage = true; std::ostringstream e; - cmake::MessageType messageType = cmake::AUTHOR_WARNING; + MessageType messageType = MessageType::AUTHOR_WARNING; switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { case cmPolicies::WARN: e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n"; @@ -57,14 +57,14 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args, case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::REQUIRED_IF_USED: case cmPolicies::NEW: - messageType = cmake::FATAL_ERROR; + messageType = MessageType::FATAL_ERROR; break; } if (issueMessage) { e << "The BREAK command does not accept any arguments."; this->Makefile->IssueMessage(messageType, e.str()); - if (messageType == cmake::FATAL_ERROR) { + if (messageType == MessageType::FATAL_ERROR) { return false; } } |