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. */
|
2008-10-12 18:41:06 +02:00
|
|
|
#ifndef cmFunctionBlocker_h
|
|
|
|
#define cmFunctionBlocker_h
|
|
|
|
|
2009-02-07 16:14:30 +02:00
|
|
|
#include "cmListFileCache.h"
|
2017-04-14 19:02:05 +02:00
|
|
|
|
|
|
|
class cmExecutionStatus;
|
2008-10-12 18:41:06 +02:00
|
|
|
class cmMakefile;
|
|
|
|
|
|
|
|
class cmFunctionBlocker
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* should a function be blocked
|
|
|
|
*/
|
2016-07-09 11:21:54 +02:00
|
|
|
virtual bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
|
|
|
|
cmExecutionStatus& status) = 0;
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* should this function blocker be removed, useful when one function adds a
|
2013-03-16 19:13:01 +02:00
|
|
|
* blocker and another must remove it
|
2008-10-12 18:41:06 +02:00
|
|
|
*/
|
2016-07-09 11:21:54 +02:00
|
|
|
virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile&)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
virtual ~cmFunctionBlocker() {}
|
2009-02-07 16:14:30 +02:00
|
|
|
|
|
|
|
/** Set/Get the context in which this blocker is created. */
|
|
|
|
void SetStartingContext(cmListFileContext const& lfc)
|
2016-07-09 11:21:54 +02:00
|
|
|
{
|
|
|
|
this->StartingContext = lfc;
|
|
|
|
}
|
2016-03-13 13:35:51 +01:00
|
|
|
cmListFileContext const& GetStartingContext() const
|
2016-07-09 11:21:54 +02:00
|
|
|
{
|
|
|
|
return this->StartingContext;
|
|
|
|
}
|
|
|
|
|
2009-02-07 16:14:30 +02:00
|
|
|
private:
|
|
|
|
cmListFileContext StartingContext;
|
2008-10-12 18:41:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|