cmContinueCommand.cxx 1.06 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4
#include "cmContinueCommand.h"

5
#include "cmExecutionStatus.h"
6
#include "cmMakefile.h"
7
#include "cmMessageType.h"
8 9
#include "cmSystemTools.h"

10
// cmContinueCommand
11 12
bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus& status)
13
{
14
  if (!this->Makefile->IsLoopBlock()) {
15
    this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
16 17 18 19
                                 "A CONTINUE command was found outside of a "
                                 "proper FOREACH or WHILE loop scope.");
    cmSystemTools::SetFatalErrorOccured();
    return true;
20
  }
21

22
  status.SetContinueInvoked();
23

24
  if (!args.empty()) {
25
    this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
26 27 28 29
                                 "The CONTINUE command does not accept any "
                                 "arguments.");
    cmSystemTools::SetFatalErrorOccured();
    return true;
30
  }
31 32 33

  return true;
}