summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Defaults.py
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2010-08-15 22:01:07 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2010-08-15 22:01:07 (GMT)
commit644700cb7ec169e1e6a856c1c05d63d6022132f1 (patch)
treebc132e3f897cabd5c1935a6cd8f787f28bc5bc24 /src/engine/SCons/Defaults.py
parent1ef3efb9b491fc87bccce16721564f79a377bce3 (diff)
downloadSCons-644700cb7ec169e1e6a856c1c05d63d6022132f1.zip
SCons-644700cb7ec169e1e6a856c1c05d63d6022132f1.tar.gz
SCons-644700cb7ec169e1e6a856c1c05d63d6022132f1.tar.bz2
Fix CPPDEFINES problems with dicts (both Append and MergeFlags). From Jean-Baptiste Lab. Fixes issue #2671.
Diffstat (limited to 'src/engine/SCons/Defaults.py')
-rw-r--r--src/engine/SCons/Defaults.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index 2311b50..dbefcbf 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -373,9 +373,20 @@ def processDefines(defs):
l = []
for d in defs:
if SCons.Util.is_List(d) or isinstance(d, tuple):
- l.append(str(d[0]) + '=' + str(d[1]))
- else:
+ if len(d) >= 2:
+ l.append(str(d[0]) + '=' + str(d[1]))
+ else:
+ l.append(str(d[0]))
+ elif SCons.Util.is_Dict(d):
+ for macro,value in d.iteritems():
+ if value is not None:
+ l.append(str(macro) + '=' + str(value))
+ else:
+ l.append(str(macro))
+ elif SCons.Util.is_String(d):
l.append(str(d))
+ else:
+ raise
elif SCons.Util.is_Dict(defs):
# The items in a dictionary are stored in random order, but
# if the order of the command-line options changes from