added support for features array to toolchains

Jimmy Brisson 2016-06-03 16:07:30 -05:00
parent 2904e10924
commit 90ecda6b73
2 changed files with 6 additions and 1 deletions

View File

@ -58,7 +58,7 @@ def cached(func):
class Target:
# Cumulative attributes can have values appended to them, so they
# need to be computed differently than regular attributes
__cumulative_attributes = ['extra_labels', 'macros']
__cumulative_attributes = ['extra_labels', 'macros', 'features']
# {target_name: target_instance} map for all the targets in the system
__target_map = {}

View File

@ -324,6 +324,11 @@ class mbedToolchain:
# Add target's symbols
self.symbols += self.target.macros
# Add target's hardware
try :
self.symbols += ["DEVICE_" + feature + "=1" for feature in self.target.features]
except AttributeError :
pass
# Add extra symbols passed via 'macros' parameter
self.symbols += self.macros