[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-1068-gb27fc92
Stephen Kelly
steveire at gmail.com
Sat Mar 15 04:27:58 EDT 2014
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 b27fc923f1da5c208fd0ff9356fc9ee888b611fe (commit)
via b003f7f46d4464b0d9d8644265f85a4deb02eb58 (commit)
from 6577bfdcb9c5088494b6ac0bd64ae5a1b01272d4 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b27fc923f1da5c208fd0ff9356fc9ee888b611fe
commit b27fc923f1da5c208fd0ff9356fc9ee888b611fe
Merge: 6577bfd b003f7f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 15 04:27:57 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Mar 15 04:27:57 2014 -0400
Merge topic 'target-objects-refactor' into next
b003f7f4 Partial revert.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b003f7f46d4464b0d9d8644265f85a4deb02eb58
commit b003f7f46d4464b0d9d8644265f85a4deb02eb58
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 15 09:26:37 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Mar 15 09:27:14 2014 +0100
Partial revert.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e909418..2a144c6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -310,34 +310,20 @@ cmGeneratorTarget
::GetObjectSources(std::vector<cmSourceFile const*> &data) const
{
IMPLEMENT_VISIT(ObjectSources);
-
- if (!this->Objects.empty())
- {
- return;
- }
-
- for(std::vector<cmSourceFile const*>::const_iterator it = data.begin();
- it != data.end(); ++it)
- {
- this->Objects[*it];
- }
-
- this->LocalGenerator->ComputeObjectFilenames(this->Objects, this);
-}
-
-void cmGeneratorTarget::ComputeObjectMapping()
-{
- std::vector<cmSourceFile const*> sourceFiles;
- this->GetObjectSources(sourceFiles);
}
//----------------------------------------------------------------------------
const std::string& cmGeneratorTarget::GetObjectName(cmSourceFile const* file)
{
- this->ComputeObjectMapping();
return this->Objects[file];
}
+void cmGeneratorTarget::AddObject(cmSourceFile const* sf,
+ std::string const&name)
+{
+ this->Objects[sf] = name;
+}
+
//----------------------------------------------------------------------------
void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf)
{
@@ -587,9 +573,6 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
cmTarget* objLib = *ti;
cmGeneratorTarget* ogt =
this->GlobalGenerator->GetGeneratorTarget(objLib);
-
- ogt->ComputeObjectMapping();
-
std::vector<cmSourceFile const*> objectSources;
ogt->GetObjectSources(objectSources);
for(std::vector<cmSourceFile const*>::const_iterator
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 22735c6..53e27c5 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -35,6 +35,7 @@ public:
void GetObjectSources(std::vector<cmSourceFile const*> &) const;
const std::string& GetObjectName(cmSourceFile const* file);
+ void AddObject(cmSourceFile const* sf, std::string const&name);
bool HasExplicitObjectName(cmSourceFile const* file) const;
void AddExplicitObjectName(cmSourceFile const* sf);
@@ -124,9 +125,7 @@ private:
typedef std::map<cmSourceFile const*, SourceEntry> SourceEntriesType;
SourceEntriesType SourceEntries;
- void ComputeObjectMapping();
-
- mutable std::map<cmSourceFile const*, std::string> Objects;
+ std::map<cmSourceFile const*, std::string> Objects;
std::set<cmSourceFile const*> ExplicitObjectName;
std::vector<cmTarget*> ObjectLibraries;
mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a4998f9..5b6d729 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1451,6 +1451,7 @@ void cmGlobalGenerator::ComputeGeneratorTargetObjects()
cmGeneratorTarget* gt = ti->second;
this->ComputeTargetObjectDirectory(gt);
gt->LookupObjectLibraries();
+ this->ComputeTargetObjects(gt);
}
}
}
@@ -1515,6 +1516,29 @@ cmGlobalGenerator::GetGeneratorTarget(cmTarget const* t) const
}
//----------------------------------------------------------------------------
+void cmGlobalGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
+{
+ std::vector<cmSourceFile const*> objectSources;
+ gt->GetObjectSources(objectSources);
+
+ std::map<cmSourceFile const*, std::string> mapping;
+ for(std::vector<cmSourceFile const*>::const_iterator it
+ = objectSources.begin(); it != objectSources.end(); ++it)
+ {
+ mapping[*it];
+ }
+
+ gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
+
+ for(std::map<cmSourceFile const*, std::string>::const_iterator it
+ = mapping.begin(); it != mapping.end(); ++it)
+ {
+ assert(!it->second.empty());
+ gt->AddObject(it->first, it->second);
+ }
+}
+
+//----------------------------------------------------------------------------
void cmGlobalGenerator::ComputeTargetObjectDirectory(cmGeneratorTarget*) const
{
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 5366733..49a418d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -443,6 +443,7 @@ private:
void CreateGeneratorTargets(cmMakefile* mf);
void CreateGeneratorTargets();
void ComputeGeneratorTargetObjects();
+ void ComputeTargetObjects(cmGeneratorTarget* gt) const;
void ClearGeneratorMembers();
-----------------------------------------------------------------------
Summary of changes:
Source/cmGeneratorTarget.cxx | 29 ++++++-----------------------
Source/cmGeneratorTarget.h | 5 ++---
Source/cmGlobalGenerator.cxx | 24 ++++++++++++++++++++++++
Source/cmGlobalGenerator.h | 1 +
4 files changed, 33 insertions(+), 26 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list