Skip to content

Commit f4294c6

Browse files
authored
[tool][cdk.py] scons的CDK工具宏定义改用分号作分隔符,并支持LIBS (#7610)
1 parent 3a75466 commit f4294c6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/cdk.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def _CDKProject(tree, target, script):
6363
CPPDEFINES = []
6464
LINKFLAGS = ''
6565
CCFLAGS = ''
66+
LIBS = []
6667
ProjectFiles = []
6768

6869
for child in root:
@@ -101,6 +102,8 @@ def _CDKProject(tree, target, script):
101102
LINKFLAGS += group['LINKFLAGS']
102103

103104
# todo: cdk add lib
105+
if 'LIBS' in group and group['LIBS']:
106+
LIBS += group['LIBS']
104107

105108
# write include path, definitions and link flags
106109
text = ';'.join([_make_path_relative(project_path, os.path.normpath(i)) for i in CPPPATH])
@@ -110,14 +113,20 @@ def _CDKProject(tree, target, script):
110113
IncludePath.text = text
111114

112115
Define = tree.find('BuildConfigs/BuildConfig/Compiler/Define')
113-
Define.text = ', '.join(set(CPPDEFINES))
116+
Define.text = '; '.join(set(CPPDEFINES))
114117

115118
CC_Misc = tree.find('BuildConfigs/BuildConfig/Compiler/OtherFlags')
116119
CC_Misc.text = CCFLAGS
117120

118121
LK_Misc = tree.find('BuildConfigs/BuildConfig/Linker/OtherFlags')
119122
LK_Misc.text = LINKFLAGS
120-
123+
124+
LibName = tree.find('BuildConfigs/BuildConfig/Linker/LibName')
125+
if LibName.text:
126+
LibName.text=LibName.text+';'+';'.join(LIBS)
127+
else:
128+
LibName.text=';'.join(LIBS)
129+
121130
xml_indent(root)
122131
out.write(etree.tostring(root, encoding='utf-8'))
123132
out.close()

0 commit comments

Comments
 (0)