cmContinueCommand.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 "cmContinueCommand.h"
  4. #include "cmExecutionStatus.h"
  5. #include "cmSystemTools.h"
  6. // cmContinueCommand
  7. bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
  8. cmExecutionStatus& status)
  9. {
  10. if (!this->Makefile->IsLoopBlock()) {
  11. this->Makefile->IssueMessage(cmake::FATAL_ERROR,
  12. "A CONTINUE command was found outside of a "
  13. "proper FOREACH or WHILE loop scope.");
  14. cmSystemTools::SetFatalErrorOccured();
  15. return true;
  16. }
  17. status.SetContinueInvoked(true);
  18. if (!args.empty()) {
  19. this->Makefile->IssueMessage(cmake::FATAL_ERROR,
  20. "The CONTINUE command does not accept any "
  21. "arguments.");
  22. cmSystemTools::SetFatalErrorOccured();
  23. return true;
  24. }
  25. return true;
  26. }