diff --git a/tools/build_api.py b/tools/build_api.py index 7a267a0405..790b1bcb65 100644 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -438,6 +438,18 @@ def scan_resources(src_paths, toolchain, dependencies_paths=None, # Set the toolchain's configuration data toolchain.set_config_data(toolchain.config.get_config_data()) + if (hasattr(toolchain.target, "release_versions") and + "5" not in toolchain.target.release_versions and + "rtos" in toolchain.config.lib_config_data): + if "Cortex-A" in toolchain.target.core: + raise NotSupportedException( + ("%s Will be supported in mbed OS 5.6. " + "To use the %s, please checkout the mbed OS 5.4 release branch. " + "See https://developer.mbed.org/platforms/Renesas-GR-PEACH/#important-notice " + "for more information") % (toolchain.target.name, toolchain.target.name)) + else: + raise NotSupportedException("Target does not support mbed OS 5") + return resources def build_project(src_paths, build_path, target, toolchain_name, @@ -519,17 +531,6 @@ def build_project(src_paths, build_path, target, toolchain_name, try: # Call unified scan_resources resources = scan_resources(src_paths, toolchain, inc_dirs=inc_dirs) - if (hasattr(toolchain.target, "release_versions") and - "5" not in toolchain.target.release_versions and - "rtos" in toolchain.config.lib_config_data): - if "Cortex-A" in toolchain.target.core: - raise NotSupportedException( - ("%s Will be supported in mbed OS 5.6. " - "To use the %s, please checkout the mbed OS 5.4 release branch. " - "See https://developer.mbed.org/platforms/Renesas-GR-PEACH/#important-notice " - "for more information") % (toolchain.target.name, toolchain.target.name)) - else: - raise NotSupportedException("Target does not support mbed OS 5") # Change linker script if specified if linker_script is not None: diff --git a/tools/project.py b/tools/project.py index 05f5c0a7d0..ff59f5b9d4 100644 --- a/tools/project.py +++ b/tools/project.py @@ -20,6 +20,7 @@ from tools.utils import argparse_filestring_type, argparse_profile_filestring_ty from tools.utils import argparse_force_lowercase_type from tools.utils import argparse_force_uppercase_type from tools.utils import print_large_string +from tools.utils import NotSupportedException from tools.options import extract_profile, list_profiles, extract_mcus def setup_project(ide, target, program=None, source_dir=None, build=None, export_path=None): @@ -246,11 +247,13 @@ def main(): profile = extract_profile(parser, options, toolchain_name, fallback="debug") if options.clean: rmtree(BUILD_DIR) - export(mcu, options.ide, build=options.build, - src=options.source_dir, macros=options.macros, - project_id=options.program, zip_proj=zip_proj, - build_profile=profile, app_config=options.app_config) - + try: + export(mcu, options.ide, build=options.build, + src=options.source_dir, macros=options.macros, + project_id=options.program, zip_proj=zip_proj, + build_profile=profile, app_config=options.app_config) + except NotSupportedException as exc: + print "[ERROR] %s" % str(exc) if __name__ == "__main__": main()