[Tools] Change building script for Py3

This commit is contained in:
Bernard Xiong
2018-11-10 18:29:08 +08:00
parent b69baa9658
commit d687cfb228
15 changed files with 150 additions and 87 deletions
+5 -5
View File
@@ -56,7 +56,7 @@ def _CDKProject(tree, target, script):
project_path = os.path.dirname(os.path.abspath(target))
root = tree.getroot()
out = file(target, 'wb')
out = open(target, 'w')
out.write('<?xml version="1.0" encoding="UTF-8"?>\n')
CPPPATH = []
@@ -73,28 +73,28 @@ def _CDKProject(tree, target, script):
group_tree = SDKAddGroup(ProjectFiles, root, group['name'], group['src'], project_path)
# get each include path
if group.has_key('CPPPATH') and group['CPPPATH']:
if 'CPPPATH' in group and group['CPPPATH']:
if CPPPATH:
CPPPATH += group['CPPPATH']
else:
CPPPATH += group['CPPPATH']
# get each group's definitions
if group.has_key('CPPDEFINES') and group['CPPDEFINES']:
if 'CPPDEFINES' in group and group['CPPDEFINES']:
if CPPDEFINES:
CPPDEFINES += group['CPPDEFINES']
else:
CPPDEFINES += group['CPPDEFINES']
# get each group's cc flags
if group.has_key('CCFLAGS') and group['CCFLAGS']:
if 'CCFLAGS' in group and group['CCFLAGS']:
if CCFLAGS:
CCFLAGS += ' ' + group['CCFLAGS']
else:
CCFLAGS += group['CCFLAGS']
# get each group's link flags
if group.has_key('LINKFLAGS') and group['LINKFLAGS']:
if 'LINKFLAGS' in group and group['LINKFLAGS']:
if LINKFLAGS:
LINKFLAGS += ' ' + group['LINKFLAGS']
else: