summaryrefslogtreecommitdiff
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-18 17:06:14 +0200
committerStephen Kelly <steveire@gmail.com>2015-10-24 09:19:53 +0200
commit67b2f4312c431eb363dd94a2bb5d88cc6c8a7c95 (patch)
tree11419dddadbd492b9baef008e3e70eff5ae3e402 /Source/cmGlobalXCodeGenerator.cxx
parentf528e6bcb9b2e181dcd7ee0c1cc327b6cad84ad5 (diff)
downloadcmake-67b2f4312c431eb363dd94a2bb5d88cc6c8a7c95.tar.gz
Port to GetGeneratorTargets.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx37
1 files changed, 23 insertions, 14 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index c06f503bdf..fe115ac4c3 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -510,17 +510,20 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
continue;
}
- cmTargets& tgts = lg->GetMakefile()->GetTargets();
- for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
+ std::vector<cmGeneratorTarget*> tgts = lg->GetGeneratorTargets();
+ for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ l != tgts.end(); l++)
{
- cmTarget& target = l->second;
+ cmTarget& target = *(*l)->Target;
if (target.GetType() == cmState::GLOBAL_TARGET)
{
continue;
}
- if (regenerate && (l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET))
+ std::string targetName = target.GetName();
+
+ if (regenerate && (targetName != CMAKE_CHECK_BUILD_SYSTEM_TARGET))
{
target.AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
}
@@ -1085,21 +1088,26 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
targets)
{
this->SetCurrentLocalGenerator(gen);
- cmTargets &tgts = this->CurrentMakefile->GetTargets();
- typedef std::map<std::string, cmTarget*, cmCompareTargets> cmSortedTargets;
+ std::vector<cmGeneratorTarget*> tgts =
+ this->CurrentLocalGenerator->GetGeneratorTargets();
+ typedef std::map<std::string, cmGeneratorTarget*, cmCompareTargets>
+ cmSortedTargets;
cmSortedTargets sortedTargets;
- for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
+ for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ l != tgts.end(); l++)
{
- sortedTargets[l->first] = &l->second;
+ sortedTargets[(*l)->GetName()] = *l;
}
for(cmSortedTargets::iterator l = sortedTargets.begin();
l != sortedTargets.end(); l++)
{
- cmTarget& cmtarget = *l->second;
- cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
+ cmGeneratorTarget* gtgt = l->second;
+ cmTarget& cmtarget = *gtgt->Target;
+
+ std::string targetName = gtgt->GetName();
// make sure ALL_BUILD, INSTALL, etc are only done once
- if(this->SpecialTargetEmitted(l->first.c_str()))
+ if(this->SpecialTargetEmitted(targetName.c_str()))
{
continue;
}
@@ -3062,10 +3070,11 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
}
cmMakefile* mf = (*i)->GetMakefile();
std::vector<cmSourceGroup> sourceGroups = mf->GetSourceGroups();
- cmTargets &tgts = mf->GetTargets();
- for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
+ std::vector<cmGeneratorTarget*> tgts = (*i)->GetGeneratorTargets();
+ for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ l != tgts.end(); l++)
{
- cmTarget& cmtarget = l->second;
+ cmTarget& cmtarget = *(*l)->Target;
// Same skipping logic here as in CreateXCodeTargets so that we do not
// end up with (empty anyhow) ALL_BUILD and XCODE_DEPEND_HELPER source