Skip to content

Progen data refactor #1563

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 6 commits into from
Feb 25, 2016
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
2 changes: 1 addition & 1 deletion workspace_tools/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def export(project_path, project_name, ide, target, destination='/tmp/',
except AttributeError:
pass
if use_progen:
if not ProGenDef(ide).is_supported(TARGET_MAP[target].progen_target):
if not ProGenDef(ide).is_supported(TARGET_MAP[target].progen['target']):
supported = False
else:
if target not in Exporter.TARGETS:
Expand Down
2 changes: 1 addition & 1 deletion workspace_tools/export/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def progen_get_project_data(self):
'includes': {
'Include Files': self.resources.headers + self.resources.inc_dirs,
},
'target': [TARGET_MAP[self.target].progen_target],
'target': [TARGET_MAP[self.target].progen['target']],
'macros': self.get_symbols(),
'export_dir': [self.inputDir],
'linker_file': [self.resources.linker_script],
Expand Down
31 changes: 18 additions & 13 deletions workspace_tools/export/iar.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class IAREmbeddedWorkbench(Exporter):
TARGETS = []
for target in TARGET_NAMES:
try:
if (ProGenDef('iar').is_supported(TARGET_MAP[target]) or
ProGenDef('iar').is_supported(TARGET_MAP[target].progen_target)):
if (ProGenDef('iar').is_supported(str(TARGET_MAP[target])) or
ProGenDef('iar').is_supported(TARGET_MAP[target].progen['target'])):
TARGETS.append(target)
except AttributeError:
# target is not supported yet
Expand All @@ -47,19 +47,24 @@ class IAREmbeddedWorkbench(Exporter):
def generate(self):
""" Generates the project files """
project_data = self.progen_get_project_data()
tool_specific = {}
# Expand tool specific settings by IAR specific settings which are required
# by the mbed projects
tool_specific = {
'iar': {
# We currently don't use misc, template sets those for us
# 'misc': {
# 'cxx_flags': ['--no_rtti', '--no_exceptions'],
# 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
# 'ld_flags': ['--skip_dynamic_initialization'],
# },
'template': [os.path.join(os.path.dirname(__file__), 'iar_template.ewp.tmpl')],
try:
if TARGET_MAP[self.target].progen['iar']['template']:
tool_specific['iar'] = TARGET_MAP[self.target].progen['iar']
except KeyError:
# use default template
# by the mbed projects
tool_specific['iar'] = {
# We currently don't use misc, template sets those for us
# 'misc': {
# 'cxx_flags': ['--no_rtti', '--no_exceptions'],
# 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
# 'ld_flags': ['--skip_dynamic_initialization'],
# },
'template': [os.path.join(os.path.dirname(__file__), 'iar_template.ewp.tmpl')],
}
}

project_data['tool_specific'] = {}
project_data['tool_specific'].update(tool_specific)
self.progen_gen_file('iar_arm', project_data)
Expand Down
Loading