cmake/Source/cmWhileCommand.h

63 lines
1.6 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. */
#ifndef cmWhileCommand_h
#define cmWhileCommand_h
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2017-07-20 19:35:53 +02:00
2017-04-14 19:02:05 +02:00
#include <string>
#include <vector>
2016-07-09 11:21:54 +02:00
2017-04-14 19:02:05 +02:00
#include "cmCommand.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
2017-04-14 19:02:05 +02:00
class cmExecutionStatus;
class cmMakefile;
class cmWhileFunctionBlocker : public cmFunctionBlocker
{
public:
2015-08-17 11:37:30 +02:00
cmWhileFunctionBlocker(cmMakefile* mf);
2018-01-26 17:06:56 +01:00
~cmWhileFunctionBlocker() override;
2016-10-30 18:24:19 +01:00
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
2018-01-26 17:06:56 +01:00
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
2013-03-16 19:13:01 +02:00
std::vector<cmListFileArgument> Args;
std::vector<cmListFileFunction> Functions;
2016-07-09 11:21:54 +02:00
private:
2015-08-17 11:37:30 +02:00
cmMakefile* Makefile;
int Depth;
};
2012-04-19 19:04:21 +03:00
/// \brief Starts a while loop
class cmWhileCommand : public cmCommand
{
public:
/**
* This is a virtual constructor for the command.
*/
2018-01-26 17:06:56 +01:00
cmCommand* Clone() override { return new cmWhileCommand; }
/**
* This overrides the default InvokeInitialPass implementation.
* It records the arguments before expansion.
*/
2016-10-30 18:24:19 +01:00
bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
2018-01-26 17:06:56 +01:00
cmExecutionStatus&) override;
2013-03-16 19:13:01 +02:00
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
2016-10-30 18:24:19 +01:00
bool InitialPass(std::vector<std::string> const&,
2018-01-26 17:06:56 +01:00
cmExecutionStatus&) override
2016-07-09 11:21:54 +02:00
{
return false;
}
};
#endif