cmDisallowedCommand.cxx 1.0 KB

12345678910111213141516171819202122232425262728293031
  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 "cmake.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(cmake::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(cmake::FATAL_ERROR, this->Message);
  21. return true;
  22. }
  23. this->Command->SetMakefile(this->GetMakefile());
  24. bool const ret = this->Command->InitialPass(args, status);
  25. this->SetError(this->Command->GetError());
  26. return ret;
  27. }