summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-04-29 17:43:43 +0800
committerGitHub <[email protected]>2019-04-29 17:43:43 +0800
commit8afa24c81133f7bdc42392ffc148c27afb0cb1fb (patch)
tree4314ea5733866b488447f343cc31c0279ebdfc0d /tools
parent3ae69adf9e276c53678dae5862eb0434745db9b9 (diff)
parent28e06fe01278e2dc5053cdc2fe72aac5dd84bdfa (diff)
Merge pull request #2635 from ericQiang/rtt_dev
修复scons创建mdk工程时,group组中有多个library的情况下,会重复创建同名group.
Diffstat (limited to 'tools')
-rw-r--r--tools/keil.py11
1 files 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