@@ -37,8 +37,8 @@ class IAREmbeddedWorkbench(Exporter):
37
37
TARGETS = []
38
38
for target in TARGET_NAMES :
39
39
try :
40
- if (ProGenDef ('iar' ).is_supported (TARGET_MAP [target ]) or
41
- ProGenDef ('iar' ).is_supported (TARGET_MAP [target ].progen_target )):
40
+ if (ProGenDef ('iar' ).is_supported (str ( TARGET_MAP [target ]) ) or
41
+ ProGenDef ('iar' ).is_supported (TARGET_MAP [target ].progen [ 'target' ] )):
42
42
TARGETS .append (target )
43
43
except AttributeError :
44
44
# target is not supported yet
@@ -47,19 +47,24 @@ class IAREmbeddedWorkbench(Exporter):
47
47
def generate (self ):
48
48
""" Generates the project files """
49
49
project_data = self .progen_get_project_data ()
50
+ tool_specific = {}
50
51
# Expand tool specific settings by IAR specific settings which are required
51
- # by the mbed projects
52
- tool_specific = {
53
- 'iar' : {
54
- # We currently don't use misc, template sets those for us
55
- # 'misc': {
56
- # 'cxx_flags': ['--no_rtti', '--no_exceptions'],
57
- # 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
58
- # 'ld_flags': ['--skip_dynamic_initialization'],
59
- # },
60
- 'template' : [os .path .join (os .path .dirname (__file__ ), 'iar_template.ewp.tmpl' )],
52
+ try :
53
+ if TARGET_MAP [self .target ].progen ['iar' ]['template' ]:
54
+ tool_specific ['iar' ] = TARGET_MAP [self .target ].progen ['iar' ]
55
+ except KeyError :
56
+ # use default template
57
+ # by the mbed projects
58
+ tool_specific ['iar' ] = {
59
+ # We currently don't use misc, template sets those for us
60
+ # 'misc': {
61
+ # 'cxx_flags': ['--no_rtti', '--no_exceptions'],
62
+ # 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
63
+ # 'ld_flags': ['--skip_dynamic_initialization'],
64
+ # },
65
+ 'template' : [os .path .join (os .path .dirname (__file__ ), 'iar_template.ewp.tmpl' )],
61
66
}
62
- }
67
+
63
68
project_data ['tool_specific' ] = {}
64
69
project_data ['tool_specific' ].update (tool_specific )
65
70
self .progen_gen_file ('iar_arm' , project_data )
0 commit comments