Skip to content

Commit 2fe708d

Browse files
committed
added features support to all of the toolchains
1 parent 76e6c88 commit 2fe708d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

workspace_tools/targets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def wrapper(*args, **kwargs):
5858
class Target:
5959
# Cumulative attributes can have values appended to them, so they
6060
# need to be computed differently than regular attributes
61-
__cumulative_attributes = ['extra_labels', 'macros']
61+
__cumulative_attributes = ['extra_labels', 'macros', 'features']
6262

6363
# Utility function: traverse a dictionary and change all the strings in the dictionary to
6464
# ASCII from Unicode. Needed because the original mbed target definitions were written in

workspace_tools/toolchains/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ def get_symbols(self):
298298

299299
# Add target's symbols
300300
self.symbols += self.target.macros
301+
# Add target's hardware
302+
try :
303+
self.symbols += ["DEVICE_" + feature + "=1" for feature in self.target.features]
304+
except AttributeError :
305+
pass
301306
# Add extra symbols passed via 'macros' parameter
302307
self.symbols += self.macros
303308

0 commit comments

Comments
 (0)