Skip to content

Minimize the size of uvision include paths #6487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tools/export/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,20 @@ def is_target_supported(cls, target_name):
def all_supported_targets(cls):
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):
"""Generate a list of supported targets for a given compiler and post-binary hook
Expand Down
15 changes: 0 additions & 15 deletions tools/export/gnuarmeclipse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,21 +417,6 @@ def compute_exclusions(self):

# -------------------------------------------------------------------------

@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):
for k in nodes.keys():
node = nodes[k]
Expand Down
5 changes: 3 additions & 2 deletions tools/export/uvision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def format_flags(self):
template = ["--no_vla", "--cpp", "--c99"]
# Flag is invalid if set in template
# Optimizations are also set in the template
invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x)
invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x)
flags['c_flags'] = [flag.replace('"','\\"') for flag in c_flags if not invalid_flag(flag)]
flags['c_flags'] = " ".join(flags['c_flags'])
flags['ld_flags'] = " ".join(flags['ld_flags'])
Expand Down Expand Up @@ -215,7 +215,8 @@ def generate(self):
# UVFile tuples defined above
'project_files': sorted(list(self.format_src(srcs).items()),
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),
}
sct_file = self.resources.linker_script
Expand Down