On Friday 24 October 2014 10:20:42 Brad King wrote:
> On 10/24/2014 10:02 AM, Brad King wrote:
> > I bisected it down to:
> > 
> > commit 5abfde6cb8a1ae0b2825797eab6c2e9842eb7c49
> > Author: Ben Boeckel <ben.boec...@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.
> 
> Here is a minimal standalone example:
> 
>  $ cat regression.cmake
>  function(func var_name)
>    list(APPEND ${var_name} value)
>    set(${var_name} ${${var_name}} PARENT_SCOPE)
>    set(${var_name} ${${var_name}} PARENT_SCOPE)
>  endfunction()
>  func(var)
>  message(STATUS " var=[${var}]")
>  func(var)
>  message(STATUS " var=[${var}]")
> 
>  $ cmake-3.0 -P regression.cmake
>  --  var=[value]
>  --  var=[value;value]
> 
>  $ cmake-3.1 -P regression.cmake
>  --  var=[value]
>  --  var=[value]
> 
> -Brad

Even simpler:

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

function(test_set)
    set(blah "value2")
    message(STATUS "before PARENT_SCOPE blah=${blah}")
    set(blah ${blah} PARENT_SCOPE)
    message(STATUS "after PARENT_SCOPE blah=${blah}")
endfunction()

set(blah value1)
test_set()
message(FATAL_ERROR "in parent scope, blah=${blah}")
------------------------------------------

With CMake master:
-- before PARENT_SCOPE blah=value2
-- after PARENT_SCOPE blah=value1
CMake Error at CMakeLists.txt:13 (message):
  in parent scope, blah=value2

With CMake 3.0.2:
-- before PARENT_SCOPE blah=value2
-- after PARENT_SCOPE blah=value2
CMake Error at CMakeLists.txt:13 (message):
  in parent scope, blah=value2

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to