summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-26 00:13:22 +0200
committerStephen Kelly <steveire@gmail.com>2015-06-30 23:14:22 +0200
commit48c6a92b286522cf350412d6dd3219b263e9ab5b (patch)
tree6fd6555edc27f5335d333b398890679e520c9488 /Source
parente28e110d221a50687cc9922743366b2f34ccd852 (diff)
downloadcmake-48c6a92b286522cf350412d6dd3219b263e9ab5b.tar.gz
cmMakefile: Merge two Scope types and instances.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx48
1 files changed, 18 insertions, 30 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0edced5f60..cdcf88c159 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1626,35 +1626,6 @@ bool cmMakefile::IsRootMakefile() const
return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
}
-//----------------------------------------------------------------------------
-class cmMakefileCurrent
-{
- cmGlobalGenerator* GG;
- cmMakefile* CurrentMakefile;
- cmState::Snapshot Snapshot;
-public:
- cmMakefileCurrent(cmMakefile* mf)
- {
- this->GG = mf->GetGlobalGenerator();
- this->CurrentMakefile = this->GG->GetCurrentMakefile();
- this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
- this->GG->GetCMakeInstance()->SetCurrentSnapshot(
- this->GG->GetCMakeInstance()->GetCurrentSnapshot());
- this->GG->SetCurrentMakefile(mf);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
- this->GG->GetFileLockPool().PushFileScope();
-#endif
- }
- ~cmMakefileCurrent()
- {
-#if defined(CMAKE_BUILD_WITH_CMAKE)
- this->GG->GetFileLockPool().PopFileScope();
-#endif
- this->GG->SetCurrentMakefile(this->CurrentMakefile);
- this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
- }
-};
-
class cmMakefile::BuildsystemFileScope
{
public:
@@ -1667,24 +1638,41 @@ public:
this->Makefile->ListFileStack.push_back(currentStart);
this->Makefile->PushPolicyBarrier();
this->Makefile->PushFunctionBlockerBarrier();
+
+ this->GG = mf->GetGlobalGenerator();
+ this->CurrentMakefile = this->GG->GetCurrentMakefile();
+ this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
+ this->GG->GetCMakeInstance()->SetCurrentSnapshot(
+ this->GG->GetCMakeInstance()->GetCurrentSnapshot());
+ this->GG->SetCurrentMakefile(mf);
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ this->GG->GetFileLockPool().PushFileScope();
+#endif
}
~BuildsystemFileScope()
{
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
this->Makefile->PopPolicyBarrier(this->ReportError);
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ this->GG->GetFileLockPool().PopFileScope();
+#endif
+ this->GG->SetCurrentMakefile(this->CurrentMakefile);
+ this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
}
void Quiet() { this->ReportError = false; }
private:
cmMakefile* Makefile;
+ cmGlobalGenerator* GG;
+ cmMakefile* CurrentMakefile;
+ cmState::Snapshot Snapshot;
bool ReportError;
};
//----------------------------------------------------------------------------
void cmMakefile::Configure()
{
- cmMakefileCurrent cmf(this);
BuildsystemFileScope scope(this);
// make sure the CMakeFiles dir is there