mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 05:10:26 +08:00
[tools] Using object name to decide whether use alias name in Keil MDK.
This commit is contained in:
parent
6459839f28
commit
b6951f64b8
@ -66,9 +66,19 @@ def MDK4AddGroupForFN(ProjectFiles, parent, name, filename, project_path):
|
|||||||
file = SubElement(files, 'File')
|
file = SubElement(files, 'File')
|
||||||
file_name = SubElement(file, 'FileName')
|
file_name = SubElement(file, 'FileName')
|
||||||
name = os.path.basename(path)
|
name = os.path.basename(path)
|
||||||
if ProjectFiles.count(name):
|
|
||||||
|
if name.find('.cpp') != -1:
|
||||||
|
obj_name = name.replace('.cpp', '.o')
|
||||||
|
elif name.find('.c') != -1:
|
||||||
|
obj_name = name.replace('.c', '.o')
|
||||||
|
elif name.find('.s') != -1:
|
||||||
|
obj_name = name.replace('.s', '.o')
|
||||||
|
elif name.find('.S') != -1:
|
||||||
|
obj_name = name.replace('.s', '.o')
|
||||||
|
|
||||||
|
if ProjectFiles.count(obj_name):
|
||||||
name = basename + '_' + name
|
name = basename + '_' + name
|
||||||
ProjectFiles.append(name)
|
ProjectFiles.append(obj_name)
|
||||||
file_name.text = name.decode(fs_encoding)
|
file_name.text = name.decode(fs_encoding)
|
||||||
file_type = SubElement(file, 'FileType')
|
file_type = SubElement(file, 'FileType')
|
||||||
file_type.text = '%d' % _get_filetype(name)
|
file_type.text = '%d' % _get_filetype(name)
|
||||||
@ -98,9 +108,19 @@ def MDK4AddGroup(ProjectFiles, parent, name, files, project_path):
|
|||||||
file = SubElement(files, 'File')
|
file = SubElement(files, 'File')
|
||||||
file_name = SubElement(file, 'FileName')
|
file_name = SubElement(file, 'FileName')
|
||||||
name = os.path.basename(path)
|
name = os.path.basename(path)
|
||||||
if ProjectFiles.count(name):
|
|
||||||
|
if name.find('.cpp') != -1:
|
||||||
|
obj_name = name.replace('.cpp', '.o')
|
||||||
|
elif name.find('.c') != -1:
|
||||||
|
obj_name = name.replace('.c', '.o')
|
||||||
|
elif name.find('.s') != -1:
|
||||||
|
obj_name = name.replace('.s', '.o')
|
||||||
|
elif name.find('.S') != -1:
|
||||||
|
obj_name = name.replace('.s', '.o')
|
||||||
|
|
||||||
|
if ProjectFiles.count(obj_name):
|
||||||
name = basename + '_' + name
|
name = basename + '_' + name
|
||||||
ProjectFiles.append(name)
|
ProjectFiles.append(obj_name)
|
||||||
file_name.text = name.decode(fs_encoding)
|
file_name.text = name.decode(fs_encoding)
|
||||||
file_type = SubElement(file, 'FileType')
|
file_type = SubElement(file, 'FileType')
|
||||||
file_type.text = '%d' % _get_filetype(name)
|
file_type.text = '%d' % _get_filetype(name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user