Skip to content

Correct SW4STM32 supported check #5990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tools/export/sw4stm32/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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.
Expand Down Expand Up @@ -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):
"""
Expand Down