Skip to content
  • Clinton Stimpson's avatar
    genex: Preserve order while evaluating TARGET_OBJECTS · caa4b7b8
    Clinton Stimpson authored and Brad King's avatar Brad King committed
    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.
    caa4b7b8