[tools] Using object name to decide whether use alias name in Keil MDK.
This commit is contained in:
parent
b6951f64b8
commit
1e38f39bea
|
@ -221,9 +221,19 @@ def MDK5AddGroupForFN(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)
|
||||||
|
@ -253,9 +263,19 @@ def MDK5AddGroup(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…
Reference in New Issue