mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
Set the error after argument expansion in end commands
The current code is optimized for rare error cases. Simplify the code and remove these optimizations.
This commit is contained in:
committed by
Brad King
parent
1afbe7d2cc
commit
d23a019684
@@ -3,10 +3,9 @@
|
||||
#include "cmEndForEachCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
bool cmEndForEachCommand::InvokeInitialPass(
|
||||
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
|
||||
bool cmEndForEachCommand::InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&)
|
||||
{
|
||||
this->SetError("An ENDFOREACH command was found outside of a proper "
|
||||
"FOREACH ENDFOREACH structure. Or its arguments did "
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "cmCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
/** \class cmEndForEachCommand
|
||||
* \brief ends an if block
|
||||
@@ -25,22 +24,12 @@ public:
|
||||
*/
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmEndForEachCommand; }
|
||||
|
||||
/**
|
||||
* Override cmCommand::InvokeInitialPass to get arguments before
|
||||
* expansion.
|
||||
*/
|
||||
bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This is called when the command is first encountered in
|
||||
* the CMakeLists.txt file.
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This determines if the command is invoked when in script mode.
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
#include "cmEndFunctionCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
bool cmEndFunctionCommand::InvokeInitialPass(
|
||||
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
|
||||
bool cmEndFunctionCommand::InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&)
|
||||
{
|
||||
this->SetError("An ENDFUNCTION command was found outside of a proper "
|
||||
"FUNCTION ENDFUNCTION structure. Or its arguments did not "
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "cmCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
/** \class cmEndFunctionCommand
|
||||
* \brief ends an if block
|
||||
@@ -25,22 +24,12 @@ public:
|
||||
*/
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmEndFunctionCommand; }
|
||||
|
||||
/**
|
||||
* Override cmCommand::InvokeInitialPass to get arguments before
|
||||
* expansion.
|
||||
*/
|
||||
bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This is called when the command is first encountered in
|
||||
* the CMakeLists.txt file.
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This determines if the command is invoked when in script mode.
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
#include "cmEndMacroCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
bool cmEndMacroCommand::InvokeInitialPass(
|
||||
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
|
||||
bool cmEndMacroCommand::InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&)
|
||||
{
|
||||
this->SetError("An ENDMACRO command was found outside of a proper "
|
||||
"MACRO ENDMACRO structure. Or its arguments did not "
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "cmCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
/** \class cmEndMacroCommand
|
||||
* \brief ends an if block
|
||||
@@ -25,22 +24,12 @@ public:
|
||||
*/
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmEndMacroCommand; }
|
||||
|
||||
/**
|
||||
* Override cmCommand::InvokeInitialPass to get arguments before
|
||||
* expansion.
|
||||
*/
|
||||
bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This is called when the command is first encountered in
|
||||
* the CMakeLists.txt file.
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This determines if the command is invoked when in script mode.
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
#include "cmEndWhileCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
bool cmEndWhileCommand::InvokeInitialPass(
|
||||
std::vector<cmListFileArgument> const&, cmExecutionStatus&)
|
||||
bool cmEndWhileCommand::InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&)
|
||||
{
|
||||
this->SetError("An ENDWHILE command was found outside of a proper "
|
||||
"WHILE ENDWHILE structure. Or its arguments did not "
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "cmCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
struct cmListFileArgument;
|
||||
|
||||
/** \class cmEndWhileCommand
|
||||
* \brief ends a while loop
|
||||
@@ -25,22 +24,12 @@ public:
|
||||
*/
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmEndWhileCommand; }
|
||||
|
||||
/**
|
||||
* Override cmCommand::InvokeInitialPass to get arguments before
|
||||
* expansion.
|
||||
*/
|
||||
bool InvokeInitialPass(std::vector<cmListFileArgument> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This is called when the command is first encountered in
|
||||
* the CMakeLists.txt file.
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This determines if the command is invoked when in script mode.
|
||||
|
||||
Reference in New Issue
Block a user