summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorshiwa <[email protected]>2023-06-09 08:59:32 +0800
committerGitHub <[email protected]>2023-06-09 08:59:32 +0800
commitf4294c6abc40ba4a1133e668414c02ea2a3b8d54 (patch)
treef34bbbca94a205fe03667c6a2d2ef0265f1f0d06 /tools
parent3a7546671a69c83a5fd5756ebefa7a64906b99e6 (diff)
[tool][cdk.py] scons的CDK工具宏定义改用分号作分隔符,并支持LIBS (#7610)
Diffstat (limited to 'tools')
-rw-r--r--tools/cdk.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/cdk.py b/tools/cdk.py
index 89e50839ad..8a473f7291 100644
--- a/tools/cdk.py
+++ b/tools/cdk.py
@@ -63,6 +63,7 @@ def _CDKProject(tree, target, script):
CPPDEFINES = []
LINKFLAGS = ''
CCFLAGS = ''
+ LIBS = []
ProjectFiles = []
for child in root:
@@ -101,6 +102,8 @@ def _CDKProject(tree, target, script):
LINKFLAGS += group['LINKFLAGS']
# todo: cdk add lib
+ if 'LIBS' in group and group['LIBS']:
+ LIBS += group['LIBS']
# write include path, definitions and link flags
text = ';'.join([_make_path_relative(project_path, os.path.normpath(i)) for i in CPPPATH])
@@ -110,14 +113,20 @@ def _CDKProject(tree, target, script):
IncludePath.text = text
Define = tree.find('BuildConfigs/BuildConfig/Compiler/Define')
- Define.text = ', '.join(set(CPPDEFINES))
+ Define.text = '; '.join(set(CPPDEFINES))
CC_Misc = tree.find('BuildConfigs/BuildConfig/Compiler/OtherFlags')
CC_Misc.text = CCFLAGS
LK_Misc = tree.find('BuildConfigs/BuildConfig/Linker/OtherFlags')
LK_Misc.text = LINKFLAGS
-
+
+ LibName = tree.find('BuildConfigs/BuildConfig/Linker/LibName')
+ if LibName.text:
+ LibName.text=LibName.text+';'+';'.join(LIBS)
+ else:
+ LibName.text=';'.join(LIBS)
+
xml_indent(root)
out.write(etree.tostring(root, encoding='utf-8'))
out.close()