cmContinueCommand.cxx 1.0 KB

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