From a3b210fd6cb85cba76f867e93d94dd835fa3278a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 6 Jun 2015 13:14:04 +0200 Subject: [PATCH] cmGeneratorTarget: Require a cmLocalGenerator to construct. --- Source/cmGeneratorTarget.cxx | 5 +++-- Source/cmGeneratorTarget.h | 2 +- Source/cmGlobalGenerator.cxx | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 482eefddc..449455306 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -220,11 +220,12 @@ struct TagVisitor }; //---------------------------------------------------------------------------- -cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t), +cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) + : Target(t), SourceFileFlagsConstructed(false) { this->Makefile = this->Target->GetMakefile(); - this->LocalGenerator = this->Makefile->GetLocalGenerator(); + this->LocalGenerator = lg; this->GlobalGenerator = this->Makefile->GetGlobalGenerator(); } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 645b79284..675ee9ffa 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -24,7 +24,7 @@ class cmTarget; class cmGeneratorTarget { public: - cmGeneratorTarget(cmTarget*); + cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg); cmLocalGenerator* GetLocalGenerator() const; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index c4396c628..14eaeac7a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1465,7 +1465,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg) ti != targets.end(); ++ti) { cmTarget* t = &ti->second; - cmGeneratorTarget* gt = new cmGeneratorTarget(t); + cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg); this->ComputeTargetObjectDirectory(gt); this->GeneratorTargets[t] = gt; generatorTargets[t] = gt; @@ -1475,7 +1475,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg) j = mf->GetOwnedImportedTargets().begin(); j != mf->GetOwnedImportedTargets().end(); ++j) { - cmGeneratorTarget* gt = new cmGeneratorTarget(*j); + cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg); this->GeneratorTargets[*j] = gt; generatorTargets[*j] = gt; }