[cmake-developers] Severe behavioural change regressions in release branch

Alex Merry alex.merry at kde.org
Fri Oct 24 10:15:35 EDT 2014


On Friday 24 October 2014 10:02:31 Brad King wrote:
> On 10/24/2014 09:50 AM, Brad King wrote:
> > With 3.0 we see the list of headers accumulate.  With 3.1 just the
> > first one works and the rest do not.
> 
> I bisected it down to:
> 
> commit 5abfde6cb8a1ae0b2825797eab6c2e9842eb7c49
> Author: Ben Boeckel <ben.boeckel at kitware.com>
> Date:   Wed Mar 12 14:01:45 2014 -0400
> 
>     cmDefinitions: Don't store parent lookups
> 
>     When looking up scopes, it is faster to not store the lookup locally to
>     keep the maps smaller and avoid extra allocations and rebalancing.
> 
> -Brad

Which matches my trimmed-down testcase:

-----------------------------------------------------------------
cmake_minimum_required(VERSION 3.0)
project(Minimal NONE)

function(test_append varname entry)
    list(APPEND ${varname} "${entry}")
    set(${varname} ${${varname}} PARENT_SCOPE)
    set(${varname} ${${varname}} PARENT_SCOPE)
endfunction()

test_append(blah entry1)
message(STATUS "blah=${blah}")
test_append(blah entry2)
message(FATAL_ERROR "blah=${blah}")
-----------------------------------------------------------------

It's that double-setting of the variable in the parent scope that seems to be 
the killer.

Alex




More information about the cmake-developers mailing list