env.Clone() in scons doesn't do a deep-copy -


In a SCON script, I can create a base environment from which I get other environments. Something like this:

  base = environment () based on [ 'CXXFLAGS'] = [ '-DBOOST_HAS_PTHREAD', '-D__STDC_CONSTANT_MACROS', '-DFILELOG_MAX_LEVEL = 4', '-Wall'] Opt = base.Clone () opt [ 'CXXFLAGS'] = [ '-DNDEBUG', '-O3']  

this way, I can make more environment (release / debug / based environment equipment / iv) that env.Clone (it is stated in SCONS documents) makes a deep copy of env but really does not seem to work, for example, based on in-DNDEBUG and environment - O3 flags will apply.

Is anyone doing something wrong?

EDIT: Here is the real code. This code has two print statements and I think that they should print the same things, but they do not do that. The production is as follows:

  # - * - coding: utf-8 - * - import os.path import Globe local_env = Environment () local_env [ 'CXXFLAGS'] = [ '-DBOOST_HAS_PTHREAD' '-D__STDC_CONSTANT_MACROS', '-DFILELOG_MAX_LEVEL = 4', '-Wall'] local_env.Append (LIBS = [ 'pthread', 'boost_thread', 'boost_filesystem', 'boost_program_options', 'boost_iostreams']) oPT = local_env. Clone () opt [ 'CXXFLAGS'] = [ '-DNDEBUG', '-O3'] print opt ​​[ 'CXXFLAGS'] = Instr OptkClone () Instr [ 'CXXFLAGS'] = [ '-fprofile- arcs'] Install ['LIBS'] + = ['GCov'] Print Opt ['CFFLAGS']  

Output:

  || Skins: Reading scanscript file ... || -DBOOST_HAS_PTHREAD -D__STDC_CONSTANT_MACROS -DFILELOG_MAX_LEVEL = 4 -Wall -DNDEBUG -O3 || -DBOOST_HAS_PTHREAD -D__STDC_CONSTANT_MACROS -DFILELOG_MAX_LEVEL = 4 -Wall -DNDEBUG -O3 -fprofile-arcs || Scots: Reading scanscript files || Scone: Building Goal ... || Scone: `. ' is up to date. || Skins: Building targets created  

Edit 2 :

It is a bug with SCons

Edit 3 :

will be fixed in 1.3.1 and 2.0.1

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -