Create a mixed (set of values) CPPDEFINES in SCons

I want to set the compiler to -DBLUB and also -DFOO = 1 .

Currently, I only have:

env.Append("CPPDEFINES", ["BLUB", "VALUE2"])

Now I want to include the third definition through "FOO": 1 and thus use CPPDEFINES as a dictionary so that I can run the test quite easily in the future

env["CPPDEFINES"].get("FOO") == 1

or so. Everything I tried leads to syntax errors or strange errors. Can anyone explain weird ways to do this in python for me?

+5
source share
1 answer

If you need to specify a value for any single definition, it CPPDEFINESshould be a dictionary.

scons:

$CPPDEFINES - , CPPDEFPREFIX $CPPDEFSUFFIX . - , ; None, .

:

env.Append(CPPDEFINES = { 'BLUB': None, 'VALUE2': None, 'Foo': 1 })

env.Append(CPPDEFINES = { 'BLUB': None, 'VALUE2': None })
...and sometime later...
env.Append(CPPDEFINES = { 'Foo': 1 })
+4

All Articles