cmDisallowedCommand.cxx 1007 B

1234567891011121314151617181920212223242526272829
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmDisallowedCommand.h"
  4. #include "cmMakefile.h"
  5. #include "cmMessageType.h"
  6. class cmExecutionStatus;
  7. bool cmDisallowedCommand::InitialPass(std::vector<std::string> const& args,
  8. cmExecutionStatus& status)
  9. {
  10. switch (this->Makefile->GetPolicyStatus(this->Policy)) {
  11. case cmPolicies::WARN:
  12. this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING,
  13. cmPolicies::GetPolicyWarning(this->Policy));
  14. break;
  15. case cmPolicies::OLD:
  16. break;
  17. case cmPolicies::REQUIRED_IF_USED:
  18. case cmPolicies::REQUIRED_ALWAYS:
  19. case cmPolicies::NEW:
  20. this->Makefile->IssueMessage(MessageType::FATAL_ERROR, this->Message);
  21. return true;
  22. }
  23. this->Command->SetExecutionStatus(this->GetExecutionStatus());
  24. return this->Command->InitialPass(args, status);
  25. }