cmake/Source/cmContinueCommand.cxx

34 lines
1.0 KiB
C++
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2015-04-27 22:25:09 +02:00
#include "cmContinueCommand.h"
2017-04-14 19:02:05 +02:00
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmake.h"
2015-04-27 22:25:09 +02:00
// cmContinueCommand
2016-07-09 11:21:54 +02:00
bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status)
2015-04-27 22:25:09 +02:00
{
2016-07-09 11:21:54 +02:00
if (!this->Makefile->IsLoopBlock()) {
2015-04-27 22:25:09 +02:00
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"A CONTINUE command was found outside of a "
"proper FOREACH or WHILE loop scope.");
cmSystemTools::SetFatalErrorOccured();
return true;
2016-07-09 11:21:54 +02:00
}
2015-04-27 22:25:09 +02:00
2017-07-20 19:35:53 +02:00
status.SetContinueInvoked();
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
if (!args.empty()) {
2015-04-27 22:25:09 +02:00
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"The CONTINUE command does not accept any "
"arguments.");
cmSystemTools::SetFatalErrorOccured();
return true;
2016-07-09 11:21:54 +02:00
}
2015-04-27 22:25:09 +02:00
return true;
}