From 2fe708d526fb05be84267a73ab39827193df6fe7 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Thu, 2 Jun 2016 14:19:51 -0500 Subject: [PATCH] added features support to all of the toolchains --- workspace_tools/targets.py | 2 +- workspace_tools/toolchains/__init__.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/workspace_tools/targets.py b/workspace_tools/targets.py index 6fb1ca9c5a..097c5bbfc6 100755 --- a/workspace_tools/targets.py +++ b/workspace_tools/targets.py @@ -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'] # Utility function: traverse a dictionary and change all the strings in the dictionary to # ASCII from Unicode. Needed because the original mbed target definitions were written in diff --git a/workspace_tools/toolchains/__init__.py b/workspace_tools/toolchains/__init__.py index d122fb72d1..97c6f20f6b 100644 --- a/workspace_tools/toolchains/__init__.py +++ b/workspace_tools/toolchains/__init__.py @@ -298,6 +298,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