summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-07-23 21:00:28 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-07-30 15:21:50 (GMT)
commitc76500949d3fcf5ff83ac6e7f1d565f5d786c5f0 (patch)
tree4a42eb66c6ea5c4b5b51919e015d198da427a3a4
parent89dc04af1d55a343a44e7c2de4bb92a101dd6138 (diff)
downloadCMake-c76500949d3fcf5ff83ac6e7f1d565f5d786c5f0.zip
CMake-c76500949d3fcf5ff83ac6e7f1d565f5d786c5f0.tar.gz
CMake-c76500949d3fcf5ff83ac6e7f1d565f5d786c5f0.tar.bz2
cm*FunctionBlocker: Move to source file
-rw-r--r--Source/cmForEachCommand.cxx19
-rw-r--r--Source/cmForEachCommand.h20
-rw-r--r--Source/cmFunctionCommand.cxx14
-rw-r--r--Source/cmFunctionCommand.h15
-rw-r--r--Source/cmIfCommand.cxx17
-rw-r--r--Source/cmIfCommand.h20
-rw-r--r--Source/cmMacroCommand.cxx14
-rw-r--r--Source/cmMacroCommand.h15
-rw-r--r--Source/cmWhileCommand.cxx19
-rw-r--r--Source/cmWhileCommand.h22
10 files changed, 85 insertions, 90 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 06dce2c..b04f14c 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -10,11 +10,30 @@
#include "cm_memory.hxx"
#include "cmExecutionStatus.h"
+#include "cmFunctionBlocker.h"
+#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmRange.h"
#include "cmSystemTools.h"
+class cmForEachFunctionBlocker : public cmFunctionBlocker
+{
+public:
+ cmForEachFunctionBlocker(cmMakefile* mf);
+ ~cmForEachFunctionBlocker() override;
+ bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
+ cmExecutionStatus&) override;
+ bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
+
+ std::vector<std::string> Args;
+ std::vector<cmListFileFunction> Functions;
+
+private:
+ cmMakefile* Makefile;
+ int Depth;
+};
+
cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
, Depth(0)
diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h
index cd112b8..135abf0 100644
--- a/Source/cmForEachCommand.h
+++ b/Source/cmForEachCommand.h
@@ -11,28 +11,8 @@
#include "cm_memory.hxx"
#include "cmCommand.h"
-#include "cmFunctionBlocker.h"
-#include "cmListFileCache.h"
class cmExecutionStatus;
-class cmMakefile;
-
-class cmForEachFunctionBlocker : public cmFunctionBlocker
-{
-public:
- cmForEachFunctionBlocker(cmMakefile* mf);
- ~cmForEachFunctionBlocker() override;
- bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
- cmExecutionStatus&) override;
- bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
-
- std::vector<std::string> Args;
- std::vector<cmListFileFunction> Functions;
-
-private:
- cmMakefile* Makefile;
- int Depth;
-};
/// Starts foreach() ... endforeach() block
class cmForEachCommand : public cmCommand
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 2809cf7..f8230f1 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -7,6 +7,8 @@
#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
+#include "cmFunctionBlocker.h"
+#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmRange.h"
@@ -102,6 +104,18 @@ bool cmFunctionHelperCommand::operator()(
return true;
}
+class cmFunctionFunctionBlocker : public cmFunctionBlocker
+{
+public:
+ bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
+ cmExecutionStatus&) override;
+ bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
+
+ std::vector<std::string> Args;
+ std::vector<cmListFileFunction> Functions;
+ int Depth = 0;
+};
+
bool cmFunctionFunctionBlocker::IsFunctionBlocked(
const cmListFileFunction& lff, cmMakefile& mf, cmExecutionStatus&)
{
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index 449a180..b334525 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -11,23 +11,8 @@
#include "cm_memory.hxx"
#include "cmCommand.h"
-#include "cmFunctionBlocker.h"
-#include "cmListFileCache.h"
class cmExecutionStatus;
-class cmMakefile;
-
-class cmFunctionFunctionBlocker : public cmFunctionBlocker
-{
-public:
- bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
- cmExecutionStatus&) override;
- bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
-
- std::vector<std::string> Args;
- std::vector<cmListFileFunction> Functions;
- int Depth = 0;
-};
/// Starts function() ... endfunction() block
class cmFunctionCommand : public cmCommand
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 385022c..20fe2f8 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -7,6 +7,8 @@
#include "cmConditionEvaluator.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
+#include "cmFunctionBlocker.h"
+#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOutputConverter.h"
@@ -28,6 +30,21 @@ static std::string cmIfCommandError(
return err;
}
+class cmIfFunctionBlocker : public cmFunctionBlocker
+{
+public:
+ bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
+ cmExecutionStatus&) override;
+ bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
+
+ std::vector<cmListFileArgument> Args;
+ std::vector<cmListFileFunction> Functions;
+ bool IsBlocking;
+ bool HasRun = false;
+ bool ElseSeen = false;
+ unsigned int ScopeDepth = 0;
+};
+
//=========================================================================
bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
cmMakefile& mf,
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 775e609..820ffa4 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -7,26 +7,8 @@
#include <vector>
-#include "cmFunctionBlocker.h"
-#include "cmListFileCache.h"
-
class cmExecutionStatus;
-class cmMakefile;
-
-class cmIfFunctionBlocker : public cmFunctionBlocker
-{
-public:
- bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
- cmExecutionStatus&) override;
- bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
-
- std::vector<cmListFileArgument> Args;
- std::vector<cmListFileFunction> Functions;
- bool IsBlocking;
- bool HasRun = false;
- bool ElseSeen = false;
- unsigned int ScopeDepth = 0;
-};
+struct cmListFileArgument;
/// Starts an if block
bool cmIfCommand(std::vector<cmListFileArgument> const& args,
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 1f2b5b2..a123f22 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -10,6 +10,8 @@
#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
+#include "cmFunctionBlocker.h"
+#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmRange.h"
@@ -136,6 +138,18 @@ bool cmMacroHelperCommand::operator()(
return true;
}
+class cmMacroFunctionBlocker : public cmFunctionBlocker
+{
+public:
+ bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
+ cmExecutionStatus&) override;
+ bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
+
+ std::vector<std::string> Args;
+ std::vector<cmListFileFunction> Functions;
+ int Depth = 0;
+};
+
bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
cmMakefile& mf,
cmExecutionStatus&)
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index 3ebd959..0d7083a 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -11,23 +11,8 @@
#include "cm_memory.hxx"
#include "cmCommand.h"
-#include "cmFunctionBlocker.h"
-#include "cmListFileCache.h"
class cmExecutionStatus;
-class cmMakefile;
-
-class cmMacroFunctionBlocker : public cmFunctionBlocker
-{
-public:
- bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
- cmExecutionStatus&) override;
- bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
-
- std::vector<std::string> Args;
- std::vector<cmListFileFunction> Functions;
- int Depth = 0;
-};
/// Starts macro() ... endmacro() block
class cmMacroCommand : public cmCommand
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 37d1c74..914860c 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -7,6 +7,8 @@
#include "cmConditionEvaluator.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
+#include "cmFunctionBlocker.h"
+#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
@@ -14,6 +16,23 @@
#include <string>
#include <utility>
+class cmWhileFunctionBlocker : public cmFunctionBlocker
+{
+public:
+ cmWhileFunctionBlocker(cmMakefile* mf);
+ ~cmWhileFunctionBlocker() override;
+ bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
+ cmExecutionStatus&) override;
+ bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
+
+ std::vector<cmListFileArgument> Args;
+ std::vector<cmListFileFunction> Functions;
+
+private:
+ cmMakefile* Makefile;
+ int Depth;
+};
+
cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
, Depth(0)
diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h
index 2257799..beca652 100644
--- a/Source/cmWhileCommand.h
+++ b/Source/cmWhileCommand.h
@@ -7,28 +7,8 @@
#include <vector>
-#include "cmFunctionBlocker.h"
-#include "cmListFileCache.h"
-
class cmExecutionStatus;
-class cmMakefile;
-
-class cmWhileFunctionBlocker : public cmFunctionBlocker
-{
-public:
- cmWhileFunctionBlocker(cmMakefile* mf);
- ~cmWhileFunctionBlocker() override;
- bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
- cmExecutionStatus&) override;
- bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
-
- std::vector<cmListFileArgument> Args;
- std::vector<cmListFileFunction> Functions;
-
-private:
- cmMakefile* Makefile;
- int Depth;
-};
+struct cmListFileArgument;
/// \brief Starts a while loop
bool cmWhileCommand(std::vector<cmListFileArgument> const& args,