summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGabor Bencze <b.gabor98@gmail.com>2019-07-25 14:52:50 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-20 18:42:19 (GMT)
commit0005e17d504fd50ebaec3860f4f213765e815b13 (patch)
tree8e29587d7fddab24967f203d8fb00d78c4b4ccfb /Source
parent01949a02df765cc4ad273b6163622f55d4f569ca (diff)
downloadCMake-0005e17d504fd50ebaec3860f4f213765e815b13.zip
CMake-0005e17d504fd50ebaec3860f4f213765e815b13.tar.gz
CMake-0005e17d504fd50ebaec3860f4f213765e815b13.tar.bz2
cmCommand refactor: cmContinueCommand
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCommands.cxx2
-rw-r--r--Source/cmContinueCommand.cxx20
-rw-r--r--Source/cmContinueCommand.h26
3 files changed, 15 insertions, 33 deletions
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 3e7fa72..429a599 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -121,7 +121,7 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("cmake_policy",
cm::make_unique<cmCMakePolicyCommand>());
state->AddBuiltinCommand("configure_file", cmConfigureFileCommand);
- state->AddBuiltinCommand("continue", cm::make_unique<cmContinueCommand>());
+ state->AddBuiltinCommand("continue", cmContinueCommand);
state->AddBuiltinCommand("exec_program",
cm::make_unique<cmExecProgramCommand>());
state->AddBuiltinCommand("execute_process",
diff --git a/Source/cmContinueCommand.cxx b/Source/cmContinueCommand.cxx
index 48f1f41..bb63dff 100644
--- a/Source/cmContinueCommand.cxx
+++ b/Source/cmContinueCommand.cxx
@@ -8,13 +8,14 @@
#include "cmSystemTools.h"
// cmContinueCommand
-bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status)
+bool cmContinueCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
- if (!this->Makefile->IsLoopBlock()) {
- this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "A CONTINUE command was found outside of a "
- "proper FOREACH or WHILE loop scope.");
+ 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::SetFatalErrorOccured();
return true;
}
@@ -22,9 +23,10 @@ bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
status.SetContinueInvoked();
if (!args.empty()) {
- this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "The CONTINUE command does not accept any "
- "arguments.");
+ status.GetMakefile().IssueMessage(
+ MessageType::FATAL_ERROR,
+ "The CONTINUE command does not accept any "
+ "arguments.");
cmSystemTools::SetFatalErrorOccured();
return true;
}
diff --git a/Source/cmContinueCommand.h b/Source/cmContinueCommand.h
index a85010a..ff903aa 100644
--- a/Source/cmContinueCommand.h
+++ b/Source/cmContinueCommand.h
@@ -8,34 +8,14 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmContinueCommand
+/**
* \brief Continue from an enclosing foreach or while loop
*
* cmContinueCommand returns from an enclosing foreach or while loop
*/
-class cmContinueCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmContinueCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmContinueCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif