[Cmake-commits] CMake branch, next, updated. v3.1.0-rc2-974-g14d771d

Ben Boeckel ben.boeckel at kitware.com
Mon Dec 1 12:57:26 EST 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  14d771da2db3edad9b47c7565de805fab0c50ccc (commit)
       via  20bff46023c05ee2949aebdd8221c4a4c1289451 (commit)
      from  1b1987b8d8d572da275cd0d028bfd19e66a7a6f7 (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=14d771da2db3edad9b47c7565de805fab0c50ccc
commit 14d771da2db3edad9b47c7565de805fab0c50ccc
Merge: 1b1987b 20bff46
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Dec 1 12:57:25 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Dec 1 12:57:25 2014 -0500

    Merge topic 'xcode-target-search-perf' into next
    
    20bff460 xcode: use a map to look up target pointers


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20bff46023c05ee2949aebdd8221c4a4c1289451
commit 20bff46023c05ee2949aebdd8221c4a4c1289451
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Dec 1 12:56:46 2014 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Mon Dec 1 12:56:46 2014 -0500

    xcode: use a map to look up target pointers
    
    Rather than iterating over a vector, use a map to associate targets with
    XCode objects.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b9f64e2..2dbc48c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2458,6 +2458,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
   target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
   target->AddAttribute("productName",this->CreateString(cmtarget.GetName()));
   target->SetTarget(&cmtarget);
+  this->XCodeObjectMap[&cmtarget] = target;
 
   // Add source files without build rules for editing convenience.
   if(cmtarget.GetType() == cmTarget::UTILITY)
@@ -2661,6 +2662,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
     target->AddAttribute("productType", this->CreateString(productType));
     }
   target->SetTarget(&cmtarget);
+  this->XCodeObjectMap[&cmtarget] = target;
   target->SetId(this->GetOrCreateId(
     cmtarget.GetName(), target->GetId()).c_str());
   return target;
@@ -2673,16 +2675,14 @@ cmXCodeObject* cmGlobalXCodeGenerator::FindXCodeTarget(cmTarget const* t)
     {
     return 0;
     }
-  for(std::vector<cmXCodeObject*>::iterator i = this->XCodeObjects.begin();
-      i != this->XCodeObjects.end(); ++i)
+
+  std::map<cmTarget const*, cmXCodeObject*>::const_iterator const i =
+    this->XCodeObjectMap.find(t);
+  if (i == this->XCodeObjectMap.end())
     {
-    cmXCodeObject* o = *i;
-    if(o->GetTarget() == t)
-      {
-      return o;
-      }
+    return 0;
     }
-  return 0;
+  return i->second;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 9d7b784..d2bc9d1 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -241,6 +241,7 @@ private:
   std::map<std::string, cmXCodeObject* > GroupNameMap;
   std::map<std::string, cmXCodeObject* > TargetGroup;
   std::map<std::string, cmXCodeObject* > FileRefs;
+  std::map<cmTarget const*, cmXCodeObject* > XCodeObjectMap;
   std::vector<std::string> Architectures;
   std::string GeneratorToolset;
 };

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

Summary of changes:
 Source/cmGlobalXCodeGenerator.cxx |   16 ++++++++--------
 Source/cmGlobalXCodeGenerator.h   |    1 +
 2 files changed, 9 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list