cmFunctionBlocker.cxx 785 B

123456789101112131415161718192021222324
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmFunctionBlocker.h"
  4. #include "cmExecutionStatus.h"
  5. #include "cmMakefile.h"
  6. bool cmFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
  7. cmExecutionStatus& status)
  8. {
  9. if (lff.Name.Lower == this->StartCommandName()) {
  10. this->ScopeDepth++;
  11. } else if (lff.Name.Lower == this->EndCommandName()) {
  12. this->ScopeDepth--;
  13. if (this->ScopeDepth == 0U) {
  14. cmMakefile& mf = status.GetMakefile();
  15. auto self = mf.RemoveFunctionBlocker(this, lff);
  16. return this->Replay(this->Functions, status);
  17. }
  18. }
  19. this->Functions.push_back(lff);
  20. return true;
  21. }