Merge pull request #6487 from theotherjimmy/min-uvision-include

Minimize the size of uvision include paths
pull/6494/head
Martin Kojtal 2018-03-28 09:18:53 +02:00 committed by GitHub
commit 25a2d15f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View File

@ -259,6 +259,20 @@ class Exporter(object):
def all_supported_targets(cls): def all_supported_targets(cls):
return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)] return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)]
@staticmethod
def filter_dot(str):
"""
Remove the './' or '.\\' prefix, if present.
"""
if str == None:
return None
if str[:2] == './':
return str[2:]
if str[:2] == '.\\':
return str[2:]
return str
def apply_supported_whitelist(compiler, whitelist, target): def apply_supported_whitelist(compiler, whitelist, target):
"""Generate a list of supported targets for a given compiler and post-binary hook """Generate a list of supported targets for a given compiler and post-binary hook

View File

@ -417,21 +417,6 @@ class GNUARMEclipse(Exporter):
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
@staticmethod
def filter_dot(str):
"""
Remove the './' prefix, if present.
This function assumes that resources.win_to_unix()
replaced all windows backslashes with slashes.
"""
if str == None:
return None
if str[:2] == './':
return str[2:]
return str
# -------------------------------------------------------------------------
def dump_tree(self, nodes, depth=0): def dump_tree(self, nodes, depth=0):
for k in nodes.keys(): for k in nodes.keys():
node = nodes[k] node = nodes[k]

View File

@ -215,7 +215,8 @@ class Uvision(Exporter):
# UVFile tuples defined above # UVFile tuples defined above
'project_files': sorted(list(self.format_src(srcs).items()), 'project_files': sorted(list(self.format_src(srcs).items()),
key=lambda tuple: tuple[0].lower()), key=lambda tuple: tuple[0].lower()),
'include_paths': '; '.join(self.resources.inc_dirs).encode('utf-8'), 'include_paths': ';'.join(self.filter_dot(d) for d in
self.resources.inc_dirs).encode('utf-8'),
'device': DeviceUvision(self.target), 'device': DeviceUvision(self.target),
} }
sct_file = self.resources.linker_script sct_file = self.resources.linker_script