[Scons-users] CPPDEFINES Unexpected Behavior

Dirk Bächle tshortik at gmx.de
Thu Apr 11 13:44:37 EDT 2013


Hi all,

On 11.04.2013 17:27, Managan, Rob wrote:

> I have a quick fix for the case

> Env.AppendUnique(CPPDEFINES={'test1':3, 'test2':None})

>


I looked at the code a bit more and the behaviour reported by Kyle is
not a bug, it's correct!

The point here is, that the "$CPPDEFINES" get expanded and used only
when "$_CCCOMCOM" is substituted during an actual compile.
For the given example this can be enforced by:

env = Environment()
newdefs = {'def1' : None}
env.AppendUnique(CPPDEFINES=newdefs)
print env.subst('$_CPPDEFFLAGS')

which results in the correct output:

-Ddef1

It's simply the difference between setting "$CPPDEFINES", and actually
expanding it. This also explains why Evan reported that he never seemed
to have any problems while using this feature.

@Kyle: Please check and confirm this on your side, I'd then close the
bug as INVALID.


Best regards,

Dirk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130411/03c05bfe/attachment.htm>


More information about the Scons-users mailing list