[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-1089-g4c7860e

Stephen Kelly steveire at gmail.com
Sat Mar 15 12:33:03 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  4c7860ef1a6f664545ae1ecfc86b978ecd299734 (commit)
       via  12ce20f46126fedfc96ce26e91474e672095e175 (commit)
      from  34a49dea15324864a4a1de345b35ef022597bf9e (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=4c7860ef1a6f664545ae1ecfc86b978ecd299734
commit 4c7860ef1a6f664545ae1ecfc86b978ecd299734
Merge: 34a49de 12ce20f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 15 12:33:02 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Mar 15 12:33:02 2014 -0400

    Merge topic 'target-objects-refactor' into next
    
    12ce20f4 Revert "cmGeneratorTarget: Compute target objects on demand"


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12ce20f46126fedfc96ce26e91474e672095e175
commit 12ce20f46126fedfc96ce26e91474e672095e175
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 15 17:31:49 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Mar 15 17:31:49 2014 +0100

    Revert "cmGeneratorTarget: Compute target objects on demand"
    
    This reverts commit cfe0d459a089c4a835d21458a57cc642e7593029.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 094a113..2a144c6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -310,38 +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()
-{
-  if(!this->Objects.empty())
-    {
-    return;
-    }
-  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)
 {
@@ -351,7 +333,6 @@ void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf)
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
 {
-  const_cast<cmGeneratorTarget*>(this)->ComputeObjectMapping();
   std::set<cmSourceFile const*>::const_iterator it
                                         = this->ExplicitObjectName.find(file);
   return it != this->ExplicitObjectName.end();
@@ -592,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 91d604d..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);
 
@@ -46,8 +47,6 @@ public:
   void GetCustomCommands(std::vector<cmSourceFile const*>&) const;
   void GetExpectedResxHeaders(std::set<std::string>&) const;
 
-  void ComputeObjectMapping();
-
   cmTarget* Target;
   cmMakefile* Makefile;
   cmLocalGenerator* LocalGenerator;
@@ -126,7 +125,7 @@ private:
   typedef std::map<cmSourceFile const*, SourceEntry> SourceEntriesType;
   SourceEntriesType SourceEntries;
 
-  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();
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 287c28f..d4eb85b 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -988,8 +988,6 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
     cmtarget.GetSourceFiles(classes);
     std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare());
 
-    gtgt->ComputeObjectMapping();
-
     std::vector<cmXCodeObject*> externalObjFiles;
     std::vector<cmXCodeObject*> headerFiles;
     std::vector<cmXCodeObject*> resourceFiles;

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGeneratorTarget.cxx      |   34 ++++++----------------------------
 Source/cmGeneratorTarget.h        |    5 ++---
 Source/cmGlobalGenerator.cxx      |   24 ++++++++++++++++++++++++
 Source/cmGlobalGenerator.h        |    1 +
 Source/cmGlobalXCodeGenerator.cxx |    2 --
 5 files changed, 33 insertions(+), 33 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list