CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmFunctionBlocker.h
blob3e096f2af49fe2bd41f9fbcea6ec04a4280e6eac
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <vector>
9 #include <cm/string_view>
11 #include "cmListFileCache.h"
13 class cmExecutionStatus;
14 class cmMakefile;
16 class cmFunctionBlocker
18 public:
19 /**
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;
37 private:
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;