[Scons-users] CPPDEFINES Unexpected Behavior

Evan Driscoll driscoll at cs.wisc.edu
Fri Apr 12 13:06:31 EDT 2013


On 04/12/2013 02:19 AM, Dirk Bächle wrote:

> I'm simply a little bit concered that we would have to change this in

> the Append logic. It is used for a lot of things/vars (not only

> CPPDEFINES), and in another situation the "fix" could possibly be bad

> again...



Once more... IMO, it's not the append logic that should change. It's in
whatever function puts the contents of CPPDEFINES together to form the
-D (or /D) flags.

The following already exhibits the problem; no Append/AppendUnique needed:

$ cat SConstruct
Object("foo.cpp", CPPDEFINES=[("SOMETHING", None)])
$ touch foo.cpp
$ scons -nQ
g++ -o foo.o -c -DSOMETHING=None foo.cpp


It's not *totally* clear that the above is undesirable behavior, but I
consider it as such based on the fact that CPPDEFINES={"SOMETHING":None}
works as expected.

Changing the output to fix that simple example should, as a side effect,
fix the case with Append as well.

Evan



More information about the Scons-users mailing list