mirror of
https://github.com/reactos/CMake.git
synced 2025-05-13 18:15:53 +00:00

Replace the members for the Makefile and the Error with a cmExecutionStatus. Re-implement GetMakefile and SetError based on that. Both functions should be called directly on the cmExecutionStatus that is passed to InitialPass. This will help us make all Commands immutable and remove the need for cloning.
30 lines
1007 B
C++
30 lines
1007 B
C++
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
#include "cmDisallowedCommand.h"
|
|
|
|
#include "cmMakefile.h"
|
|
#include "cmMessageType.h"
|
|
|
|
class cmExecutionStatus;
|
|
|
|
bool cmDisallowedCommand::InitialPass(std::vector<std::string> const& args,
|
|
cmExecutionStatus& status)
|
|
{
|
|
switch (this->Makefile->GetPolicyStatus(this->Policy)) {
|
|
case cmPolicies::WARN:
|
|
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING,
|
|
cmPolicies::GetPolicyWarning(this->Policy));
|
|
break;
|
|
case cmPolicies::OLD:
|
|
break;
|
|
case cmPolicies::REQUIRED_IF_USED:
|
|
case cmPolicies::REQUIRED_ALWAYS:
|
|
case cmPolicies::NEW:
|
|
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, this->Message);
|
|
return true;
|
|
}
|
|
|
|
this->Command->SetExecutionStatus(this->GetExecutionStatus());
|
|
return this->Command->InitialPass(args, status);
|
|
}
|