cmContinueCommand.cxx 983 B

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