1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-09 23:08:18 +08:00
CMake/Source/cmContinueCommand.cxx
FeRD (Frank Dana) 98a10290a8 cmSystemTools: Fix 'ErrorOccurred' spelling
Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to
's_ErrorOccurred' and 's_FatalErrorOccurred', respectively.

Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and
'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
2022-06-13 09:05:24 -04:00

36 lines
983 B
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmContinueCommand.h"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
// cmContinueCommand
bool cmContinueCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
if (!status.GetMakefile().IsLoopBlock()) {
status.GetMakefile().IssueMessage(
MessageType::FATAL_ERROR,
"A CONTINUE command was found outside of a "
"proper FOREACH or WHILE loop scope.");
cmSystemTools::SetFatalErrorOccurred();
return true;
}
status.SetContinueInvoked();
if (!args.empty()) {
status.GetMakefile().IssueMessage(
MessageType::FATAL_ERROR,
"The CONTINUE command does not accept any "
"arguments.");
cmSystemTools::SetFatalErrorOccurred();
return true;
}
return true;
}