diff --git a/tools/export/cdt/__init__.py b/tools/export/cdt/__init__.py index 21e8a15750..64c3361662 100644 --- a/tools/export/cdt/__init__.py +++ b/tools/export/cdt/__init__.py @@ -114,6 +114,14 @@ class EclipseGcc(Eclipse, GccArm): class EclipseArmc5(Eclipse, Armc5): LOAD_EXE = False NAME = "Eclipse-Armc5" + + @classmethod + def is_target_supported(cls, target_name): + target = TARGET_MAP[target_name] + if int(target.build_tools_metadata["version"]) > 0: + return "ARMC5" in target.supported_toolchains; + else: + return True class EclipseIAR(Eclipse, IAR): LOAD_EXE = True diff --git a/tools/export/makefile/__init__.py b/tools/export/makefile/__init__.py index 830c2cb252..c71aac0450 100644 --- a/tools/export/makefile/__init__.py +++ b/tools/export/makefile/__init__.py @@ -273,12 +273,45 @@ class Armc5(Arm): NAME = 'Make-ARMc5' TOOLCHAIN = "ARM" PREPROCESS_ASM = True + + @classmethod + def is_target_supported(cls, target_name): + target = TARGET_MAP[target_name] + + if int(target.build_tools_metadata["version"]) > 0: + #Although toolchain name is set to ARM above we should check for ARMC5 for 5.12/onwards + if "ARMC5" not in target.supported_toolchains: + return False + + return apply_supported_whitelist( + cls.TOOLCHAIN, cls.POST_BINARY_WHITELIST, target) class Armc6(Arm): """ARM Compiler 6 (armclang) specific generic makefile target""" NAME = 'Make-ARMc6' TOOLCHAIN = "ARMC6" - + + @classmethod + def is_target_supported(cls, target_name): + target = TARGET_MAP[target_name] + + if int(target.build_tools_metadata["version"]) > 0: + if not (len(set(target.supported_toolchains).intersection( + set(["ARM", "ARMC6"]))) > 0): + return False + + if not apply_supported_whitelist( + cls.TOOLCHAIN, cls.POST_BINARY_WHITELIST, target): + #ARMC6 is not in the list, but also check for ARM as ARM represents ARMC6 for 5.12/onwards + #and still keep cls.TOOLCHAIN as ARMC6 as thats the toolchain we want to use + return apply_supported_whitelist( + "ARM", cls.POST_BINARY_WHITELIST, target) + else: + return True + else: + return apply_supported_whitelist( + cls.TOOLCHAIN, cls.POST_BINARY_WHITELIST, target) + class IAR(Makefile): """IAR specific makefile target""" diff --git a/tools/export/uvision/__init__.py b/tools/export/uvision/__init__.py index d6beeb4a6b..55ceab7442 100644 --- a/tools/export/uvision/__init__.py +++ b/tools/export/uvision/__init__.py @@ -316,8 +316,8 @@ class UvisionArmc5(Uvision): def is_target_supported(cls, target_name): target = TARGET_MAP[target_name] if int(target.build_tools_metadata["version"]) > 0: - if not (set(target.supported_toolchains).intersection( - set(["ARMC5", "uARM"]))): + #Just check for ARMC5 as ARMC5 must be there irrespective of whether uARM is there or not if the target is staying with ARMC5 + if "ARMC5" not in target.supported_toolchains: return False else: if not (set(target.supported_toolchains).intersection( @@ -345,12 +345,11 @@ class UvisionArmc6(Uvision): def is_target_supported(cls, target_name): target = TARGET_MAP[target_name] if int(target.build_tools_metadata["version"]) > 0: - if not (set(target.supported_toolchains).intersection( - set(["ARM", "ARMC6", "uARM"]))): + if not len(set(target.supported_toolchains).intersection( + set(["ARM", "ARMC6"]))) > 0: return False else: - if not (set(target.supported_toolchains).intersection( - set(["ARMC6"]))): + if "ARMC6" not in target.supported_toolchains: return False if not DeviceCMSIS.check_supported(target_name):