summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-11 16:38:16 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-28 05:57:01 (GMT)
commit3a041c59495df26c2b7b0ee58069d27a03bd18ff (patch)
treed4611c6883b5b05dbc2fd9b0739497ddb30e4b98 /Source/cmMakefile.cxx
parentae6c8a9d68120229a2960a83b51241fdb926700a (diff)
downloadCMake-3a041c59495df26c2b7b0ee58069d27a03bd18ff.zip
CMake-3a041c59495df26c2b7b0ee58069d27a03bd18ff.tar.gz
CMake-3a041c59495df26c2b7b0ee58069d27a03bd18ff.tar.bz2
Introduce cmState::Snapshot.
Create snapshots for buildsystem directories during configure time. This class will be extended in follow up commits to snapshot all values in the cmState.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8c6b195..5d48f58 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -54,7 +54,10 @@ public:
// default is not to be building executables
cmMakefile::cmMakefile(cmLocalGenerator* localGenerator)
- : Internal(new Internals)
+ : Internal(new Internals),
+ LocalGenerator(localGenerator),
+ StateSnapshot(localGenerator->GetGlobalGenerator()
+ ->GetCMakeInstance()->GetState())
{
const cmDefinitions& defs = cmDefinitions();
const std::set<std::string> globalKeys = defs.LocalKeys();
@@ -63,6 +66,19 @@ cmMakefile::cmMakefile(cmLocalGenerator* localGenerator)
this->Internal->VarUsageStack.push(globalKeys);
this->Internal->IsSourceFileTryCompile = false;
+ if (this->LocalGenerator->GetParent())
+ {
+ cmMakefile* parentMf = this->LocalGenerator->GetParent()->GetMakefile();
+ this->StateSnapshot =
+ this->GetState()->CreateSnapshot(parentMf->StateSnapshot);
+ }
+ else
+ {
+ this->StateSnapshot =
+ this->GetState()->CreateSnapshot(this->StateSnapshot);
+ }
+
+
// Initialize these first since AddDefaultDefinitions calls AddDefinition
this->WarnUnused = false;
this->CheckSystemVars = false;