[Cmake-commits] CMake branch, next, updated. v3.4.0-rc2-1031-g623dca7
Stephen Kelly
steveire at gmail.com
Mon Oct 26 17:51:51 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 623dca799db66d64cc9a8d534f9b47bc4ab8c2e7 (commit)
via 55333e9accde64372a8c5055dde2c9f06f81ee18 (commit)
from 96b3231f81778c7d7a7bcfdbc299dd0fbd47de3b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=623dca799db66d64cc9a8d534f9b47bc4ab8c2e7
commit 623dca799db66d64cc9a8d534f9b47bc4ab8c2e7
Merge: 96b3231 55333e9
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 26 17:51:51 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 26 17:51:51 2015 -0400
Merge topic 'use-generator-target' into next
55333e9a Revert "cmLocalGenerator: Port Find method away from GetGeneratorTarget"
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55333e9accde64372a8c5055dde2c9f06f81ee18
commit 55333e9accde64372a8c5055dde2c9f06f81ee18
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 26 22:51:33 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 22:51:33 2015 +0100
Revert "cmLocalGenerator: Port Find method away from GetGeneratorTarget"
This reverts commit d111fa6817c5974a9fb4bc3b0d604493fee12a19.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d53f0e3..5928fb5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1583,12 +1583,10 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets(
- TargetTypes targetTypes,
- cmMakefile *mf,
- cmLocalGenerator *lg,
- std::map<cmTarget*, cmGeneratorTarget*> const& importedMap)
+void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
+ cmLocalGenerator *lg)
{
+ cmMakefile* mf = lg->GetMakefile();
if (targetTypes == AllTargets)
{
cmTargets& targets = mf->GetTargets();
@@ -1602,38 +1600,23 @@ void cmGlobalGenerator::CreateGeneratorTargets(
}
}
- std::vector<cmTarget*> itgts = mf->GetImportedTargets();
-
for(std::vector<cmTarget*>::const_iterator
- j = itgts.begin(); j != itgts.end(); ++j)
+ j = mf->GetOwnedImportedTargets().begin();
+ j != mf->GetOwnedImportedTargets().end(); ++j)
{
- lg->AddImportedGeneratorTarget(importedMap.find(*j)->second);
+ cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
+ this->GeneratorTargets[*j] = gt;
+ lg->AddImportedGeneratorTarget(gt);
}
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
{
- std::map<cmTarget*, cmGeneratorTarget*> importedMap;
- for(unsigned int i=0; i < this->Makefiles.size(); ++i)
- {
- cmMakefile* mf = this->Makefiles[i];
- for(std::vector<cmTarget*>::const_iterator
- j = mf->GetOwnedImportedTargets().begin();
- j != mf->GetOwnedImportedTargets().end(); ++j)
- {
- cmGeneratorTarget* gt =
- new cmGeneratorTarget(*j, this->LocalGenerators[i]);
- this->GeneratorTargets[*j] = gt;
- importedMap[*j] = gt;
- }
- }
-
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
- this->CreateGeneratorTargets(targetTypes, this->Makefiles[i],
- this->LocalGenerators[i], importedMap);
+ this->CreateGeneratorTargets(targetTypes, this->LocalGenerators[i]);
}
}
@@ -2257,11 +2240,11 @@ cmGeneratorTarget* cmGlobalGenerator::FindImportedGeneratorTargetImpl(
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
{
std::vector<cmGeneratorTarget*> tgts =
- this->LocalGenerators[i]->GetImportedGeneratorTargets();
+ this->LocalGenerators[i]->GetGeneratorTargets();
for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
it != tgts.end(); ++it)
{
- if ((*it)->IsImportedGloballyVisible() && (*it)->GetName() == name)
+ if ((*it)->GetName() == name && (*it)->IsImportedGloballyVisible())
{
return *it;
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 0057d61..c52b209 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -485,9 +485,7 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
friend class cmake;
- void CreateGeneratorTargets(TargetTypes targetTypes, cmMakefile* mf,
- cmLocalGenerator* lg,
- std::map<cmTarget*, cmGeneratorTarget*> const& importedMap);
+ void CreateGeneratorTargets(TargetTypes targetTypes, cmLocalGenerator* lg);
void CreateGeneratorTargets(TargetTypes targetTypes);
void ClearGeneratorMembers();
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ec7c29f..1bc7f81 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1821,21 +1821,11 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
cmGeneratorTarget*
cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const
{
- std::vector<cmGeneratorTarget*>::const_iterator
- imported = std::find_if(this->ImportedGeneratorTargets.begin(),
- this->ImportedGeneratorTargets.end(),
- NamedGeneratorTargetFinder(name));
- if(imported != this->ImportedGeneratorTargets.end())
+ if (cmTarget *t = this->Makefile->FindTargetToUse(name))
{
- return *imported;
+ return this->GetGlobalGenerator()->GetGeneratorTarget(t);
}
-
- if(cmGeneratorTarget* t = this->FindGeneratorTarget(name))
- {
- return t;
- }
-
- return this->GetGlobalGenerator()->FindGeneratorTarget(name);
+ return 0;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 67383d7..7841d05 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -120,11 +120,6 @@ public:
return this->GeneratorTargets;
}
- const std::vector<cmGeneratorTarget*> &GetImportedGeneratorTargets() const
- {
- return this->ImportedGeneratorTargets;
- }
-
void AddGeneratorTarget(cmGeneratorTarget* gt);
void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalGenerator.cxx | 39 +++++++++++----------------------------
Source/cmGlobalGenerator.h | 4 +---
Source/cmLocalGenerator.cxx | 16 +++-------------
Source/cmLocalGenerator.h | 5 -----
4 files changed, 15 insertions(+), 49 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list