summaryrefslogtreecommitdiff
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-24 11:50:55 +0200
committerBrad King <brad.king@kitware.com>2015-05-27 09:18:32 -0400
commit3b880a07417a0211001b8dfa721ec220e6d8d2e3 (patch)
tree47116544531b097088a6c4d233d6688d035e292e /Source/cmLocalGenerator.cxx
parente12afe766ee9083637ac819ec69a7b4512c39718 (diff)
downloadcmake-3b880a07417a0211001b8dfa721ec220e6d8d2e3.tar.gz
cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
Refactor the local generator creation API to accept a cmState::Snapshot. Adjust MakeLocalGenerator to use the 'current' snapshot in cases where there is no parent. Create the snapshot for subdirectories in cmMakefile::AddSubdirectory. This means that snapshots are now created at the point of extending the tree, as appropriate, and independently of the cmLocalGenerator and cmMakefile they represent the state for.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d00b677daa..7d8596ea19 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -44,19 +44,16 @@
#endif
cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
- cmLocalGenerator* parent)
+ cmLocalGenerator* parent,
+ cmState::Snapshot snapshot)
+ : StateSnapshot(snapshot)
{
+ assert(snapshot.IsValid());
this->GlobalGenerator = gg;
this->Parent = parent;
if (parent)
{
parent->AddChild(this);
- this->StateSnapshot =
- this->GetState()->CreateSnapshot(parent->StateSnapshot);
- }
- else
- {
- this->StateSnapshot = gg->GetCMakeInstance()->GetCurrentSnapshot();
}
this->Makefile = new cmMakefile(this);