From f88b425bfe6f0bb6b01b744523ac9ca3262a4993 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 31 Jan 2018 16:13:21 -0600 Subject: [PATCH] Correct SW4STM32 supported check --- tools/export/sw4stm32/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/export/sw4stm32/__init__.py b/tools/export/sw4stm32/__init__.py index 4a9d13fa82..a986e6d850 100644 --- a/tools/export/sw4stm32/__init__.py +++ b/tools/export/sw4stm32/__init__.py @@ -20,6 +20,7 @@ from tools.utils import mkdir from tools.export.gnuarmeclipse import GNUARMEclipse from tools.export.gnuarmeclipse import UID from tools.build_api import prepare_toolchain +from tools.targets import TARGET_MAP from sys import flags, platform # Global random number generator instance. @@ -281,7 +282,14 @@ class Sw4STM32(GNUARMEclipse): }, } - TARGETS = BOARDS.keys() + + @classmethod + def is_target_supported(cls, target_name): + target = TARGET_MAP[target_name] + target_supported = bool(set(target.resolution_order_names) + .intersection(set(cls.BOARDS.keys()))) + toolchain_supported = cls.TOOLCHAIN in target.supported_toolchains + return target_supported and toolchain_supported def __gen_dir(self, dir_name): """