cmake/Source/cmContinueCommand.cxx

36 lines
983 B
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"
2019-11-11 23:01:05 +01:00
#include "cmMessageType.h"
2017-04-14 19:02:05 +02:00
#include "cmSystemTools.h"
2015-04-27 22:25:09 +02:00
// cmContinueCommand
2020-02-01 23:06:01 +01:00
bool cmContinueCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
2015-04-27 22:25:09 +02:00
{
2020-02-01 23:06:01 +01:00
if (!status.GetMakefile().IsLoopBlock()) {
status.GetMakefile().IssueMessage(
MessageType::FATAL_ERROR,
"A CONTINUE command was found outside of a "
"proper FOREACH or WHILE loop scope.");
2022-08-04 22:12:04 +02:00
cmSystemTools::SetFatalErrorOccurred();
2015-04-27 22:25:09 +02:00
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()) {
2020-02-01 23:06:01 +01:00
status.GetMakefile().IssueMessage(
MessageType::FATAL_ERROR,
"The CONTINUE command does not accept any "
"arguments.");
2022-08-04 22:12:04 +02:00
cmSystemTools::SetFatalErrorOccurred();
2015-04-27 22:25:09 +02:00
return true;
2016-07-09 11:21:54 +02:00
}
2015-04-27 22:25:09 +02:00
return true;
}