From 28e06fe01278e2dc5053cdc2fe72aac5dd84bdfa Mon Sep 17 00:00:00 2001 From: ericQiang Date: Mon, 29 Apr 2019 14:33:31 +0800 Subject: [PATCH] =?UTF-8?q?[bug=20fix]:scons=E5=88=9B=E5=BB=BAmdk=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E6=97=B6=EF=BC=8Cgroup=E7=BB=84=E4=B8=AD=E6=9C=89?= =?UTF-8?q?=E5=A4=9A=E4=B8=AAlibrary=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E9=87=8D=E5=A4=8D=E5=88=9B=E5=BB=BA=E5=90=8C?= =?UTF-8?q?=E5=90=8Dgroup.=E4=BF=AE=E6=94=B9Tools/keil.py=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=87=BD=E6=95=B0MDK45Project=EF=BC=8C=E8=8B=A5group?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=88=9B=E5=BB=BA=EF=BC=8C=E5=88=99=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E6=B7=BB=E5=8A=A0=E5=AD=90=E8=8A=82=E7=82=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/keil.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/keil.py b/tools/keil.py index 59da254430..b096917a42 100644 --- a/tools/keil.py +++ b/tools/keil.py @@ -56,6 +56,7 @@ def _get_filetype(fn): def MDK4AddGroupForFN(ProjectFiles, parent, name, filename, project_path): group = SubElement(parent, 'Group') + group.text = name group_name = SubElement(group, 'GroupName') group_name.text = name @@ -244,9 +245,13 @@ def MDK45Project(tree, target, script): lib_path = full_path if lib_path != '': - if (group_tree != None): - MDK4AddLibToGroup(ProjectFiles, group_tree, group['name'], lib_path, project_path) - else: + need_create = 1 + for neighbor in groups.iter('Group'): + if neighbor.text == group['name']: + MDK4AddLibToGroup(ProjectFiles, neighbor, group['name'], lib_path, project_path) + need_create = 0 + break + if (need_create != 0): MDK4AddGroupForFN(ProjectFiles, groups, group['name'], lib_path, project_path) # write include path, definitions and link flags