Skip to content

Commit 10c8177

Browse files
authored
Merge pull request #5990 from theotherjimmy/fix-sw4stm32-supported
Correct SW4STM32 supported check
2 parents bf3693f + f88b425 commit 10c8177

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/export/sw4stm32/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from tools.export.gnuarmeclipse import GNUARMEclipse
2121
from tools.export.gnuarmeclipse import UID
2222
from tools.build_api import prepare_toolchain
23+
from tools.targets import TARGET_MAP
2324
from sys import flags, platform
2425

2526
# Global random number generator instance.
@@ -281,7 +282,14 @@ class Sw4STM32(GNUARMEclipse):
281282
},
282283
}
283284

284-
TARGETS = BOARDS.keys()
285+
286+
@classmethod
287+
def is_target_supported(cls, target_name):
288+
target = TARGET_MAP[target_name]
289+
target_supported = bool(set(target.resolution_order_names)
290+
.intersection(set(cls.BOARDS.keys())))
291+
toolchain_supported = cls.TOOLCHAIN in target.supported_toolchains
292+
return target_supported and toolchain_supported
285293

286294
def __gen_dir(self, dir_name):
287295
"""

0 commit comments

Comments
 (0)