summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-06 13:39:01 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-11-06 13:39:01 (GMT)
commitef3dc6507ea0e22d865d15d6231b5bdfacd8af14 (patch)
treea4829c7474c3af4e3e17ea2ce04f1c4a1fd201f7 /Source/cmGlobalGenerator.cxx
parent4d6b88d44b35896ec6a2adecc19b5d73c95539c6 (diff)
parent5cf1120fbf11fcc6bb5f5f15b0e2c8472bafc261 (diff)
downloadCMake-ef3dc6507ea0e22d865d15d6231b5bdfacd8af14.zip
CMake-ef3dc6507ea0e22d865d15d6231b5bdfacd8af14.tar.gz
CMake-ef3dc6507ea0e22d865d15d6231b5bdfacd8af14.tar.bz2
Merge topic 'clear-generator-data'
5cf1120 cmGlobalGenerator: Refactor member cleanup between configures
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx83
1 files changed, 36 insertions, 47 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ea17afa..c308f4b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -66,32 +66,12 @@ cmGlobalGenerator::cmGlobalGenerator()
cmGlobalGenerator::~cmGlobalGenerator()
{
- // Delete any existing cmLocalGenerators
- for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
- {
- delete this->LocalGenerators[i];
- }
- for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
- li = this->EvaluationFiles.begin();
- li != this->EvaluationFiles.end();
- ++li)
- {
- delete *li;
- }
- for(std::map<std::string, cmExportBuildFileGenerator*>::iterator
- i = this->BuildExportSets.begin();
- i != this->BuildExportSets.end(); ++i)
- {
- delete i->second;
- }
- this->LocalGenerators.clear();
+ this->ClearGeneratorMembers();
if (this->ExtraGenerator)
{
delete this->ExtraGenerator;
}
-
- this->ClearGeneratorTargets();
}
bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts)
@@ -970,31 +950,7 @@ bool cmGlobalGenerator::IsDependedOn(const char* project,
void cmGlobalGenerator::Configure()
{
this->FirstTimeProgress = 0.0f;
- this->ClearGeneratorTargets();
- this->ExportSets.clear();
- // Delete any existing cmLocalGenerators
- unsigned int i;
- for (i = 0; i < this->LocalGenerators.size(); ++i)
- {
- delete this->LocalGenerators[i];
- }
- this->LocalGenerators.clear();
- for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
- li = this->EvaluationFiles.begin();
- li != this->EvaluationFiles.end();
- ++li)
- {
- delete *li;
- }
- this->EvaluationFiles.clear();
- this->TargetDependencies.clear();
- this->TotalTargets.clear();
- this->ImportedTargets.clear();
- this->LocalGeneratorToTargetMap.clear();
- this->ProjectMap.clear();
- this->RuleHashes.clear();
- this->DirectoryContentMap.clear();
- this->BinaryDirectories.clear();
+ this->ClearGeneratorMembers();
// start with this directory
cmLocalGenerator *lg = this->CreateLocalGenerator();
@@ -1399,7 +1355,7 @@ void cmGlobalGenerator::ComputeGeneratorTargetObjects()
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::ClearGeneratorTargets()
+void cmGlobalGenerator::ClearGeneratorMembers()
{
for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
i != this->GeneratorTargets.end(); ++i)
@@ -1407,6 +1363,39 @@ void cmGlobalGenerator::ClearGeneratorTargets()
delete i->second;
}
this->GeneratorTargets.clear();
+
+ for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
+ li = this->EvaluationFiles.begin();
+ li != this->EvaluationFiles.end();
+ ++li)
+ {
+ delete *li;
+ }
+ this->EvaluationFiles.clear();
+
+ for(std::map<std::string, cmExportBuildFileGenerator*>::iterator
+ i = this->BuildExportSets.begin();
+ i != this->BuildExportSets.end(); ++i)
+ {
+ delete i->second;
+ }
+ this->BuildExportSets.clear();
+
+ for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ delete this->LocalGenerators[i];
+ }
+ this->LocalGenerators.clear();
+
+ this->ExportSets.clear();
+ this->TargetDependencies.clear();
+ this->TotalTargets.clear();
+ this->ImportedTargets.clear();
+ this->LocalGeneratorToTargetMap.clear();
+ this->ProjectMap.clear();
+ this->RuleHashes.clear();
+ this->DirectoryContentMap.clear();
+ this->BinaryDirectories.clear();
}
//----------------------------------------------------------------------------