File tree Expand file tree Collapse file tree 3 files changed +42
-29
lines changed Expand file tree Collapse file tree 3 files changed +42
-29
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,19 @@ class IAREmbeddedWorkbench(Exporter):
35
35
36
36
MBED_CONFIG_HEADER_SUPPORTED = True
37
37
38
- # backward compatibility with our scripts
39
- TARGETS = []
40
- for target in TARGET_NAMES :
41
- try :
42
- if (ProGenDef ('iar' ).is_supported (str (TARGET_MAP [target ])) or
43
- ProGenDef ('iar' ).is_supported (TARGET_MAP [target ].progen ['target' ])):
44
- TARGETS .append (target )
45
- except AttributeError :
46
- # target is not supported yet
47
- continue
38
+ @property
39
+ def TARGETS (self ):
40
+ if not hasattr (self , "_targets_supported" ):
41
+ self ._targets_supported = []
42
+ for target in TARGET_NAMES :
43
+ try :
44
+ if (ProGenDef ('iar' ).is_supported (str (TARGET_MAP [target ])) or
45
+ ProGenDef ('iar' ).is_supported (TARGET_MAP [target ].progen ['target' ])):
46
+ self ._targets_supported .append (target )
47
+ except AttributeError :
48
+ # target is not supported yet
49
+ continue
50
+ return self ._targets_supported
48
51
49
52
def generate (self ):
50
53
""" Generates the project files """
Original file line number Diff line number Diff line change @@ -36,16 +36,19 @@ class Uvision4(Exporter):
36
36
37
37
MBED_CONFIG_HEADER_SUPPORTED = True
38
38
39
- # backward compatibility with our scripts
40
- TARGETS = []
41
- for target in TARGET_NAMES :
42
- try :
43
- if (ProGenDef ('uvision' ).is_supported (str (TARGET_MAP [target ])) or
44
- ProGenDef ('uvision' ).is_supported (TARGET_MAP [target ].progen ['target' ])):
45
- TARGETS .append (target )
46
- except AttributeError :
47
- # target is not supported yet
48
- continue
39
+ @property
40
+ def TARGETS (self ):
41
+ if not hasattr (self , "_targets_supported" ):
42
+ self ._targets_supported = []
43
+ for target in TARGET_NAMES :
44
+ try :
45
+ if (ProGenDef ('uvision' ).is_supported (str (TARGET_MAP [target ])) or
46
+ ProGenDef ('uvision' ).is_supported (TARGET_MAP [target ].progen ['target' ])):
47
+ self ._targets_supported .append (target )
48
+ except AttributeError :
49
+ # target is not supported yet
50
+ continue
51
+ return self ._targets_supported
49
52
50
53
def get_toolchain (self ):
51
54
return TARGET_MAP [self .target ].default_toolchain
Original file line number Diff line number Diff line change @@ -37,15 +37,22 @@ class Uvision5(Exporter):
37
37
MBED_CONFIG_HEADER_SUPPORTED = True
38
38
39
39
# backward compatibility with our scripts
40
- TARGETS = []
41
- for target in TARGET_NAMES :
42
- try :
43
- if (ProGenDef ('uvision5' ).is_supported (str (TARGET_MAP [target ])) or
44
- ProGenDef ('uvision5' ).is_supported (TARGET_MAP [target ].progen ['target' ])):
45
- TARGETS .append (target )
46
- except AttributeError :
47
- # target is not supported yet
48
- continue
40
+ def __init__ (self ):
41
+ self ._targets = []
42
+
43
+ @property
44
+ def TARGETS (self ):
45
+ if not hasattr (self , "_targets_supported" ):
46
+ self ._targets_supported = []
47
+ for target in TARGET_NAMES :
48
+ try :
49
+ if (ProGenDef ('uvision5' ).is_supported (str (TARGET_MAP [target ])) or
50
+ ProGenDef ('uvision5' ).is_supported (TARGET_MAP [target ].progen ['target' ])):
51
+ self ._targets_supported .append (target )
52
+ except AttributeError :
53
+ # target is not supported yet
54
+ continue
55
+ return self ._targets_supported
49
56
50
57
def get_toolchain (self ):
51
58
return TARGET_MAP [self .target ].default_toolchain
You can’t perform that action at this time.
0 commit comments