[Cmake-commits] CMake branch, next, updated. v3.1.0-2061-g5528f24
Ben Boeckel
ben.boeckel at kitware.com
Fri Jan 16 17:40:46 EST 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 5528f24229ee49e2bb5fab3e7b4e4d117099021f (commit)
via a7cb6054223c6717c1c49378bd7446e12a5000b5 (commit)
from 017d7c3c8c666fbb5c43c266e7af9957cf710f6e (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=5528f24229ee49e2bb5fab3e7b4e4d117099021f
commit 5528f24229ee49e2bb5fab3e7b4e4d117099021f
Merge: 017d7c3 a7cb605
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Jan 16 17:40:45 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 16 17:40:45 2015 -0500
Merge topic 'xcode-target-sort' into next
a7cb6054 cmGlobalXCodeGenerator: sort targets
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7cb6054223c6717c1c49378bd7446e12a5000b5
commit a7cb6054223c6717c1c49378bd7446e12a5000b5
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Jan 16 17:37:26 2015 -0500
Commit: Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Fri Jan 16 17:38:35 2015 -0500
cmGlobalXCodeGenerator: sort targets
The default target in XCode is the first one in the file. Sort targets
so that ALL_BUILD is always first.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 13e6988..0899614 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -966,6 +966,23 @@ struct cmSourceFilePathCompare
};
//----------------------------------------------------------------------------
+struct cmCompareTargets
+{
+ bool operator () (std::string const& a, std::string const& b) const
+ {
+ if (a == "ALL_BUILD")
+ {
+ return true;
+ }
+ if (b == "ALL_BUILD")
+ {
+ return false;
+ }
+ return strcmp(a.c_str(), b.c_str()) < 0;
+ }
+};
+
+//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmXCodeObject*>&
@@ -973,9 +990,16 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
{
this->SetCurrentLocalGenerator(gen);
cmTargets &tgts = this->CurrentMakefile->GetTargets();
+ typedef std::map<std::string, cmTarget*, cmCompareTargets> cmSortedTargets;
+ cmSortedTargets sortedTargets;
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
{
- cmTarget& cmtarget = l->second;
+ sortedTargets[l->first] = &l->second;
+ }
+ for(cmSortedTargets::iterator l = sortedTargets.begin();
+ l != sortedTargets.end(); l++)
+ {
+ cmTarget& cmtarget = *l->second;
cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
// make sure ALL_BUILD, INSTALL, etc are only done once
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalXCodeGenerator.cxx | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list