[Cmake-commits] CMake branch, next, updated. v3.3.2-3195-gda0bdab

Brad King brad.king at kitware.com
Tue Sep 22 11:24:25 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  da0bdab6d9788728bf0671b22a287dd1b5517f42 (commit)
       via  40c7b4612341e4230516ef32a97449051379790a (commit)
       via  03bfe71ae055ed9e5dbeb619967ee44e5f555459 (commit)
      from  84ae6a68a62b3739015dba75a785ae6b939a882a (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=da0bdab6d9788728bf0671b22a287dd1b5517f42
commit da0bdab6d9788728bf0671b22a287dd1b5517f42
Merge: 84ae6a6 40c7b46
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 22 11:24:25 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Sep 22 11:24:25 2015 -0400

    Merge topic 'vs-target-ordering' into next
    
    40c7b461 VS: Fix rebuild with regeneration after input CMake code change (#15754)
    03bfe71a VS: Refactor target ordering logic


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40c7b4612341e4230516ef32a97449051379790a
commit 40c7b4612341e4230516ef32a97449051379790a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 22 10:20:44 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Sep 22 10:26:00 2015 -0400

    VS: Fix rebuild with regeneration after input CMake code change (#15754)
    
    When using "cmake --build ." or "MSBuild ALL_BUILD.vcxproj" to drive the
    build the dependencies in the .sln file are not considered.  This means
    that ProjectReference elements in .vcxproj files are used to order
    targets.  We must ensure that the ZERO_CHECK target is listed as the
    first dependency of every target so that when it causes regeneration of
    the build files then MSBuild has not yet loaded the updated files.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b91ae11..92403e3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2849,7 +2849,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
     = this->GlobalGenerator->GetTargetDirectDepends(this->GeneratorTarget);
   typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet
     OrderedTargetDependSet;
-  OrderedTargetDependSet depends(unordered, std::string());
+  OrderedTargetDependSet depends(unordered, CMAKE_CHECK_BUILD_SYSTEM_TARGET);
   this->WriteString("<ItemGroup>\n", 1);
   for( OrderedTargetDependSet::const_iterator i = depends.begin();
        i != depends.end(); ++i)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03bfe71ae055ed9e5dbeb619967ee44e5f555459
commit 03bfe71ae055ed9e5dbeb619967ee44e5f555459
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 22 10:14:49 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Sep 22 10:25:58 2015 -0400

    VS: Refactor target ordering logic
    
    Refactor cmGlobalVisualStudioGenerator::TargetCompare to store the name of
    the target that should come first instead of hard-coding "ALL_BUILD".
    Update client sites to specify "ALL_BUILD" when ordering for .sln files
    and an empty string otherwise (in cases when "ALL_BUILD" should not be
    encountered anyway).

diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index df49948..14de698 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -217,7 +217,7 @@ void cmGlobalVisualStudio6Generator
   TargetDependSet projectTargets;
   TargetDependSet originalTargets;
   this->GetTargetSets(projectTargets, originalTargets, root, generators);
-  OrderedTargetDependSet orderedProjectTargets(projectTargets);
+  OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
 
   for(OrderedTargetDependSet::const_iterator
         tt = orderedProjectTargets.begin();
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 607642c..b913afc 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -94,7 +94,7 @@ void cmGlobalVisualStudio71Generator
   TargetDependSet projectTargets;
   TargetDependSet originalTargets;
   this->GetTargetSets(projectTargets, originalTargets, root, generators);
-  OrderedTargetDependSet orderedProjectTargets(projectTargets);
+  OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
 
   this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
 
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 0175062..05da022 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -568,7 +568,7 @@ void cmGlobalVisualStudio7Generator
   TargetDependSet projectTargets;
   TargetDependSet originalTargets;
   this->GetTargetSets(projectTargets, originalTargets, root, generators);
-  OrderedTargetDependSet orderedProjectTargets(projectTargets);
+  OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
 
   this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
 
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 28f0425..70c00e9 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -449,7 +449,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends(
 {
   cmGeneratorTarget* gt = this->GetGeneratorTarget(&t);
   TargetDependSet const& unordered = this->GetTargetDirectDepends(gt);
-  OrderedTargetDependSet depends(unordered);
+  OrderedTargetDependSet depends(unordered, std::string());
   for(OrderedTargetDependSet::const_iterator i = depends.begin();
       i != depends.end(); ++i)
     {
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 2bf04b4..e7cc8ff 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -864,28 +864,34 @@ bool
 cmGlobalVisualStudioGenerator::TargetCompare
 ::operator()(cmGeneratorTarget const* l, cmGeneratorTarget const* r) const
 {
-  // Make sure ALL_BUILD is first so it is the default active project.
-  if(r->GetName() == "ALL_BUILD")
+  // Make sure a given named target is ordered first,
+  // e.g. to set ALL_BUILD as the default active project.
+  // When the empty string is named this is a no-op.
+  if (r->GetName() == this->First)
     {
     return false;
     }
-  if(l->GetName() == "ALL_BUILD")
+  if (l->GetName() == this->First)
     {
     return true;
     }
-  return strcmp(l->GetName().c_str(), r->GetName().c_str()) < 0;
+  return l->GetName() < r->GetName();
 }
 
 //----------------------------------------------------------------------------
 cmGlobalVisualStudioGenerator::OrderedTargetDependSet
-::OrderedTargetDependSet(TargetDependSet const& targets)
+::OrderedTargetDependSet(TargetDependSet const& targets,
+                         std::string const& first):
+  derived(TargetCompare(first))
 {
   this->insert(targets.begin(), targets.end());
 }
 
 //----------------------------------------------------------------------------
 cmGlobalVisualStudioGenerator::OrderedTargetDependSet
-::OrderedTargetDependSet(TargetSet const& targets)
+::OrderedTargetDependSet(TargetSet const& targets,
+                         std::string const& first):
+  derived(TargetCompare(first))
 {
   for (TargetSet::const_iterator it = targets.begin();
        it != targets.end(); ++it)
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index 64440ad..c940eb3 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -89,8 +89,11 @@ public:
   virtual bool TargetsWindowsCE() const { return false; }
 
   class TargetSet: public std::set<cmTarget const*> {};
-  struct TargetCompare
+  class TargetCompare
   {
+    std::string First;
+  public:
+    TargetCompare(std::string const& first): First(first) {}
     bool operator()(cmGeneratorTarget const* l,
                     cmGeneratorTarget const* r) const;
   };
@@ -151,11 +154,14 @@ class cmGlobalVisualStudioGenerator::OrderedTargetDependSet:
   public std::multiset<cmTargetDepend,
                        cmGlobalVisualStudioGenerator::TargetCompare>
 {
+  typedef std::multiset<cmTargetDepend,
+                        cmGlobalVisualStudioGenerator::TargetCompare>
+    derived;
 public:
   typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
   typedef cmGlobalVisualStudioGenerator::TargetSet TargetSet;
-  OrderedTargetDependSet(TargetDependSet const&);
-  OrderedTargetDependSet(TargetSet const&);
+  OrderedTargetDependSet(TargetDependSet const&, std::string const& first);
+  OrderedTargetDependSet(TargetSet const&, std::string const& first);
 };
 
 #endif
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index cb5048d..b91ae11 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2849,7 +2849,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
     = this->GlobalGenerator->GetTargetDirectDepends(this->GeneratorTarget);
   typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet
     OrderedTargetDependSet;
-  OrderedTargetDependSet depends(unordered);
+  OrderedTargetDependSet depends(unordered, std::string());
   this->WriteString("<ItemGroup>\n", 1);
   for( OrderedTargetDependSet::const_iterator i = depends.begin();
        i != depends.end(); ++i)

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

Summary of changes:
 Source/cmGlobalVisualStudio6Generator.cxx  |    2 +-
 Source/cmGlobalVisualStudio71Generator.cxx |    2 +-
 Source/cmGlobalVisualStudio7Generator.cxx  |    2 +-
 Source/cmGlobalVisualStudio8Generator.cxx  |    2 +-
 Source/cmGlobalVisualStudioGenerator.cxx   |   18 ++++++++++++------
 Source/cmGlobalVisualStudioGenerator.h     |   12 +++++++++---
 Source/cmVisualStudio10TargetGenerator.cxx |    2 +-
 7 files changed, 26 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list