[Cmake-commits] CMake branch, next, updated. v3.5.0-rc1-122-geb10155

Brad King brad.king at kitware.com
Wed Feb 10 14:12:36 EST 2016


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  eb101557671a0dd39864ac3e1fee586bb749cdf1 (commit)
       via  27e6a98bfd609a9d46d7711bdd2c762cb5c2e6c4 (commit)
      from  ddc180100229fd76d25a97f4310ca97ff738b2cb (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb101557671a0dd39864ac3e1fee586bb749cdf1
commit eb101557671a0dd39864ac3e1fee586bb749cdf1
Merge: ddc1801 27e6a98
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 10 14:12:36 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 10 14:12:36 2016 -0500

    Merge topic 'ninja-deterministic-gen' into next
    
    27e6a98b Ninja: Fix non-determinism in generated build statement order (#15968)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27e6a98bfd609a9d46d7711bdd2c762cb5c2e6c4
commit 27e6a98bfd609a9d46d7711bdd2c762cb5c2e6c4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 10 14:08:48 2016 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 10 14:09:17 2016 -0500

    Ninja: Fix non-determinism in generated build statement order (#15968)
    
    Generate custom command build statements in the order we encounter
    source files specifying them.  Do not depend on pointer values of
    internally allocated structures for ordering.

diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index b2927a9..8a68af6 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -454,13 +454,24 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
 void cmLocalNinjaGenerator::AddCustomCommandTarget(cmCustomCommand const* cc,
                                                    cmGeneratorTarget* target)
 {
-  this->CustomCommandTargets[cc].insert(target);
+  CustomCommandTargetMap::value_type v(cc, std::set<cmGeneratorTarget*>());
+  std::pair<CustomCommandTargetMap::iterator, bool>
+    ins = this->CustomCommandTargets.insert(v);
+  if (ins.second)
+    {
+    this->CustomCommands.push_back(cc);
+    }
+  ins.first->second.insert(target);
 }
 
 void cmLocalNinjaGenerator::WriteCustomCommandBuildStatements()
 {
-  for (CustomCommandTargetMap::iterator i = this->CustomCommandTargets.begin();
-       i != this->CustomCommandTargets.end(); ++i) {
+  for (std::vector<cmCustomCommand const*>::iterator vi =
+       this->CustomCommands.begin(); vi != this->CustomCommands.end(); ++vi)
+    {
+    CustomCommandTargetMap::iterator i = this->CustomCommandTargets.find(*vi);
+    assert(i != this->CustomCommandTargets.end());
+
     // A custom command may appear on multiple targets.  However, some build
     // systems exist where the target dependencies on some of the targets are
     // overspecified, leading to a dependency cycle.  If we assume all target
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index b6987ef..5e1d6f2 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -106,6 +106,7 @@ private:
   typedef std::map<cmCustomCommand const*, std::set<cmGeneratorTarget*> >
     CustomCommandTargetMap;
   CustomCommandTargetMap CustomCommandTargets;
+  std::vector<cmCustomCommand const*> CustomCommands;
 };
 
 #endif // ! cmLocalNinjaGenerator_h

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

Summary of changes:
 Source/cmLocalNinjaGenerator.cxx |   17 ++++++++++++++---
 Source/cmLocalNinjaGenerator.h   |    1 +
 2 files changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list