[Cmake-commits] CMake branch, next, updated. v3.5.0-rc2-108-g35c20b4

Brad King brad.king at kitware.com
Thu Feb 11 08:55:50 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  35c20b47d86644be7bc840b9584cbb85f5ff95a5 (commit)
       via  59ade844ef01f0c8a4db3a5593f79210edcf6cbc (commit)
      from  f90cc170a03e7d7f695fcc93c5013ab69b023fc4 (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=35c20b47d86644be7bc840b9584cbb85f5ff95a5
commit 35c20b47d86644be7bc840b9584cbb85f5ff95a5
Merge: f90cc17 59ade84
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 11 08:55:49 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 11 08:55:49 2016 -0500

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59ade844ef01f0c8a4db3a5593f79210edcf6cbc
commit 59ade844ef01f0c8a4db3a5593f79210edcf6cbc
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: Thu Feb 11 08:53:37 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:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list