mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2176 from 0xc0170/fix_#2171
Exporters - progen TARGETS lazy evaluatedpull/2185/head
commit
7251a8ccae
|
@ -35,16 +35,19 @@ class IAREmbeddedWorkbench(Exporter):
|
|||
|
||||
MBED_CONFIG_HEADER_SUPPORTED = True
|
||||
|
||||
# backward compatibility with our scripts
|
||||
TARGETS = []
|
||||
for target in TARGET_NAMES:
|
||||
try:
|
||||
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
|
||||
continue
|
||||
@property
|
||||
def TARGETS(self):
|
||||
if not hasattr(self, "_targets_supported"):
|
||||
self._targets_supported = []
|
||||
for target in TARGET_NAMES:
|
||||
try:
|
||||
if (ProGenDef('iar').is_supported(str(TARGET_MAP[target])) or
|
||||
ProGenDef('iar').is_supported(TARGET_MAP[target].progen['target'])):
|
||||
self._targets_supported.append(target)
|
||||
except AttributeError:
|
||||
# target is not supported yet
|
||||
continue
|
||||
return self._targets_supported
|
||||
|
||||
def generate(self):
|
||||
""" Generates the project files """
|
||||
|
|
|
@ -36,16 +36,19 @@ class Uvision4(Exporter):
|
|||
|
||||
MBED_CONFIG_HEADER_SUPPORTED = True
|
||||
|
||||
# backward compatibility with our scripts
|
||||
TARGETS = []
|
||||
for target in TARGET_NAMES:
|
||||
try:
|
||||
if (ProGenDef('uvision').is_supported(str(TARGET_MAP[target])) or
|
||||
ProGenDef('uvision').is_supported(TARGET_MAP[target].progen['target'])):
|
||||
TARGETS.append(target)
|
||||
except AttributeError:
|
||||
# target is not supported yet
|
||||
continue
|
||||
@property
|
||||
def TARGETS(self):
|
||||
if not hasattr(self, "_targets_supported"):
|
||||
self._targets_supported = []
|
||||
for target in TARGET_NAMES:
|
||||
try:
|
||||
if (ProGenDef('uvision').is_supported(str(TARGET_MAP[target])) or
|
||||
ProGenDef('uvision').is_supported(TARGET_MAP[target].progen['target'])):
|
||||
self._targets_supported.append(target)
|
||||
except AttributeError:
|
||||
# target is not supported yet
|
||||
continue
|
||||
return self._targets_supported
|
||||
|
||||
def get_toolchain(self):
|
||||
return TARGET_MAP[self.target].default_toolchain
|
||||
|
|
|
@ -37,15 +37,22 @@ class Uvision5(Exporter):
|
|||
MBED_CONFIG_HEADER_SUPPORTED = True
|
||||
|
||||
# backward compatibility with our scripts
|
||||
TARGETS = []
|
||||
for target in TARGET_NAMES:
|
||||
try:
|
||||
if (ProGenDef('uvision5').is_supported(str(TARGET_MAP[target])) or
|
||||
ProGenDef('uvision5').is_supported(TARGET_MAP[target].progen['target'])):
|
||||
TARGETS.append(target)
|
||||
except AttributeError:
|
||||
# target is not supported yet
|
||||
continue
|
||||
def __init__(self):
|
||||
self._targets = []
|
||||
|
||||
@property
|
||||
def TARGETS(self):
|
||||
if not hasattr(self, "_targets_supported"):
|
||||
self._targets_supported = []
|
||||
for target in TARGET_NAMES:
|
||||
try:
|
||||
if (ProGenDef('uvision5').is_supported(str(TARGET_MAP[target])) or
|
||||
ProGenDef('uvision5').is_supported(TARGET_MAP[target].progen['target'])):
|
||||
self._targets_supported.append(target)
|
||||
except AttributeError:
|
||||
# target is not supported yet
|
||||
continue
|
||||
return self._targets_supported
|
||||
|
||||
def get_toolchain(self):
|
||||
return TARGET_MAP[self.target].default_toolchain
|
||||
|
|
Loading…
Reference in New Issue