cmGlobalGenerator: Remove map from cmTarget to cmGeneratorTarget
The configure-time and generate-time types should be completely independent. Add ownership of cmGeneratorTarget instances to the cmLocalGenerator.
This commit is contained in:
parent
c389f8bb07
commit
79c3a2a8f7
|
@ -1208,8 +1208,6 @@ void cmGlobalGenerator::Configure()
|
|||
void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
|
||||
{
|
||||
this->CreateLocalGenerators();
|
||||
cmDeleteAll(this->GeneratorTargets);
|
||||
this->GeneratorTargets.clear();
|
||||
this->CreateGeneratorTargets(targetTypes);
|
||||
this->ComputeBuildFileGenerators();
|
||||
}
|
||||
|
@ -1597,7 +1595,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(
|
|||
{
|
||||
cmTarget* t = &ti->second;
|
||||
cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
|
||||
this->GeneratorTargets[t] = gt;
|
||||
lg->AddGeneratorTarget(gt);
|
||||
}
|
||||
}
|
||||
|
@ -1622,9 +1619,9 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
|
|||
j = mf->GetOwnedImportedTargets().begin();
|
||||
j != mf->GetOwnedImportedTargets().end(); ++j)
|
||||
{
|
||||
cmGeneratorTarget* gt =
|
||||
new cmGeneratorTarget(*j, this->LocalGenerators[i]);
|
||||
this->GeneratorTargets[*j] = gt;
|
||||
cmLocalGenerator* lg = this->LocalGenerators[i];
|
||||
cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
|
||||
lg->AddOwnedImportedGeneratorTarget(gt);
|
||||
importedMap[*j] = gt;
|
||||
}
|
||||
}
|
||||
|
@ -1641,9 +1638,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
|
|||
//----------------------------------------------------------------------------
|
||||
void cmGlobalGenerator::ClearGeneratorMembers()
|
||||
{
|
||||
cmDeleteAll(this->GeneratorTargets);
|
||||
this->GeneratorTargets.clear();
|
||||
|
||||
cmDeleteAll(this->BuildExportSets);
|
||||
this->BuildExportSets.clear();
|
||||
|
||||
|
@ -1661,20 +1655,6 @@ void cmGlobalGenerator::ClearGeneratorMembers()
|
|||
this->BinaryDirectories.clear();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmGeneratorTarget*
|
||||
cmGlobalGenerator::GetGeneratorTarget(cmTarget const* t) const
|
||||
{
|
||||
cmGeneratorTargetsType::const_iterator ti = this->GeneratorTargets.find(t);
|
||||
if(ti == this->GeneratorTargets.end())
|
||||
{
|
||||
this->CMakeInstance->IssueMessage(
|
||||
cmake::INTERNAL_ERROR, "Missing cmGeneratorTarget instance!");
|
||||
return 0;
|
||||
}
|
||||
return ti->second;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmGlobalGenerator::ComputeTargetObjectDirectory(cmGeneratorTarget*) const
|
||||
{
|
||||
|
|
|
@ -42,10 +42,6 @@ class cmInstallTargetGenerator;
|
|||
class cmInstallFilesGenerator;
|
||||
class cmExportBuildFileGenerator;
|
||||
|
||||
typedef std::map<cmTarget const*,
|
||||
cmGeneratorTarget*,
|
||||
cmTarget::StrictTargetComparison> cmGeneratorTargetsType;
|
||||
|
||||
/** \class cmGlobalGenerator
|
||||
* \brief Responsible for overseeing the generation process for the entire tree
|
||||
*
|
||||
|
@ -307,14 +303,6 @@ public:
|
|||
TargetDependSet const& GetTargetDirectDepends(
|
||||
const cmGeneratorTarget* target);
|
||||
|
||||
/** Get per-target generator information. */
|
||||
cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
|
||||
|
||||
void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
|
||||
{
|
||||
this->GeneratorTargets[t] = gt;
|
||||
}
|
||||
|
||||
const std::map<std::string, std::vector<cmLocalGenerator*> >& GetProjectMap()
|
||||
const {return this->ProjectMap;}
|
||||
|
||||
|
@ -482,8 +470,6 @@ private:
|
|||
typedef std::map<cmGeneratorTarget const*, TargetDependSet> TargetDependMap;
|
||||
TargetDependMap TargetDependencies;
|
||||
|
||||
// Per-target generator information.
|
||||
cmGeneratorTargetsType GeneratorTargets;
|
||||
friend class cmake;
|
||||
void CreateGeneratorTargets(TargetTypes targetTypes, cmMakefile* mf,
|
||||
cmLocalGenerator* lg,
|
||||
|
|
|
@ -257,7 +257,6 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
|
|||
|
||||
cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg);
|
||||
lg->AddGeneratorTarget(gt);
|
||||
this->AddGeneratorTarget(tgt, gt);
|
||||
|
||||
// Organize in the "predefined targets" folder:
|
||||
//
|
||||
|
|
|
@ -88,7 +88,6 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
|
|||
|
||||
cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
|
||||
gen[0]->AddGeneratorTarget(gt);
|
||||
this->AddGeneratorTarget(allBuild, gt);
|
||||
|
||||
#if 0
|
||||
// Can't activate this code because we want ALL_BUILD
|
||||
|
|
|
@ -460,7 +460,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|||
|
||||
cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root);
|
||||
root->AddGeneratorTarget(allBuildGt);
|
||||
root->GetGlobalGenerator()->AddGeneratorTarget(allbuild, allBuildGt);
|
||||
|
||||
// Refer to the main build configuration file for easy editing.
|
||||
std::string listfile = root->GetCurrentSourceDirectory();
|
||||
|
@ -496,7 +495,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|||
|
||||
cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root);
|
||||
root->AddGeneratorTarget(checkGt);
|
||||
root->GetGlobalGenerator()->AddGeneratorTarget(check, checkGt);
|
||||
}
|
||||
|
||||
// now make the allbuild depend on all the non-utility targets
|
||||
|
|
|
@ -62,6 +62,8 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
|
|||
|
||||
cmLocalGenerator::~cmLocalGenerator()
|
||||
{
|
||||
cmDeleteAll(this->GeneratorTargets);
|
||||
cmDeleteAll(this->OwnedImportedGeneratorTargets);
|
||||
}
|
||||
|
||||
void cmLocalGenerator::IssueMessage(cmake::MessageType t,
|
||||
|
@ -460,6 +462,11 @@ void cmLocalGenerator::AddImportedGeneratorTarget(cmGeneratorTarget* gt)
|
|||
this->ImportedGeneratorTargets.push_back(gt);
|
||||
}
|
||||
|
||||
void cmLocalGenerator::AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt)
|
||||
{
|
||||
this->OwnedImportedGeneratorTargets.push_back(gt);
|
||||
}
|
||||
|
||||
struct NamedGeneratorTargetFinder
|
||||
{
|
||||
NamedGeneratorTargetFinder(std::string const& name)
|
||||
|
|
|
@ -127,6 +127,7 @@ public:
|
|||
|
||||
void AddGeneratorTarget(cmGeneratorTarget* gt);
|
||||
void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
|
||||
void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt);
|
||||
|
||||
cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
|
||||
cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
|
||||
|
@ -380,6 +381,7 @@ protected:
|
|||
std::set<cmGeneratorTarget const*> WarnCMP0063;
|
||||
std::vector<cmGeneratorTarget*> GeneratorTargets;
|
||||
std::vector<cmGeneratorTarget*> ImportedGeneratorTargets;
|
||||
std::vector<cmGeneratorTarget*> OwnedImportedGeneratorTargets;
|
||||
std::map<std::string, std::string> AliasTargets;
|
||||
|
||||
bool EmitUniversalBinaryFlags;
|
||||
|
|
|
@ -896,7 +896,6 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
|||
|
||||
cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
|
||||
lg->AddGeneratorTarget(gt);
|
||||
lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt);
|
||||
|
||||
// Set target folder
|
||||
const char* autogenFolder = makefile->GetState()
|
||||
|
|
Loading…
Reference in New Issue