1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
9 #include <cm/string_view>
11 #include "cmListFileCache.h"
13 class cmExecutionStatus
;
16 class cmFunctionBlocker
20 * should a function be blocked
22 bool IsFunctionBlocked(cmListFileFunction
const& lff
,
23 cmExecutionStatus
& status
);
25 virtual ~cmFunctionBlocker() = default;
27 /** Set/Get the context in which this blocker is created. */
28 void SetStartingContext(cmListFileContext
const& lfc
)
30 this->StartingContext
= lfc
;
32 cmListFileContext
const& GetStartingContext() const
34 return this->StartingContext
;
38 virtual cm::string_view
StartCommandName() const = 0;
39 virtual cm::string_view
EndCommandName() const = 0;
41 virtual bool EndCommandSupportsArguments() const { return true; }
43 virtual bool ArgumentsMatch(cmListFileFunction
const& lff
,
44 cmMakefile
& mf
) const = 0;
46 virtual bool Replay(std::vector
<cmListFileFunction
> functions
,
47 cmExecutionStatus
& status
) = 0;
49 cmListFileContext StartingContext
;
50 std::vector
<cmListFileFunction
> Functions
;
51 unsigned int ScopeDepth
= 1;