summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-21 09:48:00 -0500
committerBrad King <brad.king@kitware.com>2009-01-21 09:48:00 -0500
commitb8f5a934ecb83f0124be8485708d4d6d763682fd (patch)
treed0fe8d5148a7f56eb62e222dd4e2bcbde633d438 /Source/cmMakefile.h
parentf4d37eebb26a62d2522e7d321b09f19242826d8d (diff)
downloadcmake-b8f5a934ecb83f0124be8485708d4d6d763682fd.tar.gz
ENH: Refactor logical block enforcement
This uses a stack of 'barriers' to efficiently divide function blockers into groups corresponding to each input file. It simplifies detection of missing block close commands and factors it out of ReadListFile.
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 6da36468c1..c6b332b0db 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -98,6 +98,19 @@ public:
cmsys::auto_ptr<cmFunctionBlocker>
RemoveFunctionBlocker(const cmListFileFunction& lff);
+ /** Push/pop a lexical (function blocker) barrier automatically. */
+ class LexicalPushPop
+ {
+ public:
+ LexicalPushPop(cmMakefile* mf);
+ ~LexicalPushPop();
+ void Quiet() { this->ReportError = false; }
+ private:
+ cmMakefile* Makefile;
+ bool ReportError;
+ };
+ friend class LexicalPushPop;
+
/**
* Try running cmake and building a file. This is used for dynalically
* loaded commands, not as part of the usual build process.
@@ -876,7 +889,11 @@ private:
const std::vector<std::string>& v) const;
void AddDefaultDefinitions();
- std::list<cmFunctionBlocker *> FunctionBlockers;
+ typedef std::vector<cmFunctionBlocker*> FunctionBlockersType;
+ FunctionBlockersType FunctionBlockers;
+ std::vector<FunctionBlockersType::size_type> FunctionBlockerBarriers;
+ void PushFunctionBlockerBarrier();
+ void PopFunctionBlockerBarrier(bool reportError = true);
typedef std::map<cmStdString, cmData*> DataMapType;
DataMapType DataMap;