cmake/Source/cmDisallowedCommand.cxx

32 lines
1.0 KiB
C++
Raw Normal View History

2017-07-20 19:35:53 +02:00
/* 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"
2019-11-11 23:01:05 +01:00
#include "cmMessageType.h"
2017-07-20 19:35:53 +02:00
class cmExecutionStatus;
bool cmDisallowedCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
switch (this->Makefile->GetPolicyStatus(this->Policy)) {
case cmPolicies::WARN:
2019-11-11 23:01:05 +01:00
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING,
2017-07-20 19:35:53 +02:00
cmPolicies::GetPolicyWarning(this->Policy));
break;
case cmPolicies::OLD:
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
2019-11-11 23:01:05 +01:00
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, this->Message);
2017-07-20 19:35:53 +02:00
return true;
}
this->Command->SetMakefile(this->GetMakefile());
bool const ret = this->Command->InitialPass(args, status);
this->SetError(this->Command->GetError());
return ret;
}