[Cmake-commits] CMake branch, next, updated. v3.1.0-rc1-409-g015bbfb

Brad King brad.king at kitware.com
Fri Nov 7 09:49:59 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  015bbfb551db2dcd11900a60cf268c0b8afe5fdd (commit)
       via  caa4b7b88b3845a23d0767b9e63ee6e31ca614e5 (commit)
      from  137dc18dbe0d9e319c0c355f39677fa6639f0863 (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=015bbfb551db2dcd11900a60cf268c0b8afe5fdd
commit 015bbfb551db2dcd11900a60cf268c0b8afe5fdd
Merge: 137dc18 caa4b7b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 7 09:49:58 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Nov 7 09:49:58 2014 -0500

    Merge topic 'genex-target-objects-ordering' into next
    
    caa4b7b8 genex: Preserve order while evaluating TARGET_OBJECTS


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=caa4b7b88b3845a23d0767b9e63ee6e31ca614e5
commit caa4b7b88b3845a23d0767b9e63ee6e31ca614e5
Author:     Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Thu Nov 6 20:56:50 2014 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 7 09:38:00 2014 -0500

    genex: Preserve order while evaluating TARGET_OBJECTS
    
    The logic introduced in commit v3.1.0-rc1~688^2~9 (Genex: Evaluate
    TARGET_OBJECTS as a normal expression, 2014-02-26) ordered a map
    by pointer value and then constructed a list of object files by
    iterating over the map.  This is not deterministic.
    
    Since commit v3.1.0-rc1~688^2~5 (cmTarget: Allow any generator
    expression in SOURCES property, 2014-03-18) the order produced by the
    above-mentioned logic started being used for the actual list of object
    files on the link line.  Since it is not deterministic, spurious
    re-links occur after re-running CMake simply because the order of
    objects changed on the link line.
    
    Fix this by iterating over the original vector of source files instead
    of the map.  This has a deterministic order.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index c1478df..67a1a6d 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -1286,12 +1286,16 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
     std::string obj_dir = gt->ObjectDirectory;
     std::string result;
     const char* sep = "";
-    for(std::map<cmSourceFile const*, std::string>::const_iterator it
-        = mapping.begin(); it != mapping.end(); ++it)
+    for(std::vector<cmSourceFile const*>::const_iterator it
+        = objectSources.begin(); it != objectSources.end(); ++it)
       {
-      assert(!it->second.empty());
+      // Find the object file name corresponding to this source file.
+      std::map<cmSourceFile const*, std::string>::const_iterator
+        map_it = mapping.find(*it);
+      // It must exist because we populated the mapping just above.
+      assert(!map_it->second.empty());
       result += sep;
-      std::string objFile = obj_dir + it->second;
+      std::string objFile = obj_dir + map_it->second;
       cmSourceFile* sf = context->Makefile->GetOrCreateSource(objFile, true);
       sf->SetObjectLibrary(tgtName);
       sf->SetProperty("EXTERNAL_OBJECT", "1");

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list