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
Post a Comment