Merge pull request #6540 from theotherjimmy/compile-check

Prevent compiling with unsupported compilers
pull/6735/head
Cruz Monrreal 2018-04-24 12:12:38 -05:00 committed by GitHub
commit b33ab748a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 34 additions and 1 deletions

View File

@ -289,6 +289,13 @@ def get_mbed_official_release(version):
return mbed_official_release
ARM_COMPILERS = ("ARM", "ARMC6", "uARM")
def target_supports_toolchain(target, toolchain_name):
if toolchain_name in ARM_COMPILERS:
return any(tc in target.supported_toolchains for tc in ARM_COMPILERS)
else:
return toolchain_name in target.supported_toolchains
def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
macros=None, clean=False, jobs=1,
@ -322,6 +329,11 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
# If the configuration object was not yet created, create it now
config = config or Config(target, src_paths, app_config=app_config)
target = config.target
if not target_supports_toolchain(target, toolchain_name):
raise NotSupportedException(
"Target {} is not supported by toolchain {}".format(
target.name, toolchain_name))
try:
cur_tc = TOOLCHAIN_CLASSES[toolchain_name]
except KeyError:

View File

@ -3,6 +3,7 @@
"core": "Cortex-M0",
"extra_labels": [],
"features": [],
"default_lib": "std"
"default_lib": "std",
"supported_toolchains": ["GCC_ARM"]
}
}

View File

@ -1,5 +1,6 @@
{
"base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0",

View File

@ -1,5 +1,6 @@
{
"first_base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0",
@ -10,6 +11,7 @@
}
},
"second_base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0",

View File

@ -1,5 +1,6 @@
{
"test_target": {
"supported_toolchains": ["GCC_ARM"],
"core": "Cortex-M0",
"extra_labels": [],
"features": [],

View File

@ -1,5 +1,6 @@
{
"test_target": {
"supported_toolchains": ["GCC_ARM"],
"core": "Cortex-M0",
"extra_labels": [],
"features": [],

View File

@ -1,5 +1,6 @@
{
"test_target": {
"supported_toolchains": ["GCC_ARM"],
"core": "Cortex-M0",
"extra_labels": [],
"features": [],

View File

@ -1,5 +1,6 @@
{
"test_target": {
"supported_toolchains": ["GCC_ARM"],
"core": "Cortex-M0",
"extra_labels": [],
"features": ["IPV4"],

View File

@ -1,5 +1,6 @@
{
"test_target": {
"supported_toolchains": ["GCC_ARM"],
"core": "Cortex-M0",
"extra_labels": [],
"features": [],

View File

@ -1,5 +1,6 @@
{
"test_target": {
"supported_toolchains": ["GCC_ARM"],
"core": "Cortex-M0",
"extra_labels": [],
"features": [],

View File

@ -1,5 +1,6 @@
{
"base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0"

View File

@ -1,5 +1,6 @@
{
"base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0"

View File

@ -1,5 +1,6 @@
{
"base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0",

View File

@ -1,5 +1,6 @@
{
"base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0",

View File

@ -1,5 +1,6 @@
{
"first_base_target": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0",
@ -21,6 +22,7 @@
}
},
"second_base_target": {
"supported_toolchains": ["GCC_ARM"],
"config": {
"base2_1": "v_base2_1_b2",
"base2_2": "v_base2_2_b2"

View File

@ -1,5 +1,6 @@
{
"base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0"

View File

@ -1,5 +1,6 @@
{
"base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0"

View File

@ -1,5 +1,6 @@
{
"test_target": {
"supported_toolchains": ["GCC_ARM"],
"core": "Cortex-M0",
"extra_labels": [],
"features": [],

View File

@ -1,5 +1,6 @@
{
"first_base": {
"supported_toolchains": ["GCC_ARM"],
"extra_labels": [],
"default_lib": "std",
"core": "Cortex-M0",
@ -21,6 +22,7 @@
}
},
"second_base": {
"supported_toolchains": ["GCC_ARM"],
"config": {
"base2_1": "v_base2_1_b2",
"base2_2": "v_base2_2_b2"