Skip to content

Commit d8caee9

Browse files
committed
Disallow building of mbed OS 2 + rtos
1 parent 07a6c07 commit d8caee9

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

tools/build_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,10 @@ def build_project(src_paths, build_path, target, toolchain_name,
478478
src_paths.extend(libraries_paths)
479479
inc_dirs.extend(map(dirname, libraries_paths))
480480

481-
# Build Directory
482481
if clean and exists(build_path):
483482
rmtree(build_path)
484483
mkdir(build_path)
485484

486-
# Pass all params to the unified prepare_toolchain()
487485
toolchain = prepare_toolchain(
488486
src_paths, build_path, target, toolchain_name, macros=macros,
489487
clean=clean, jobs=jobs, notify=notify, silent=silent, verbose=verbose,
@@ -513,6 +511,10 @@ def build_project(src_paths, build_path, target, toolchain_name,
513511
try:
514512
# Call unified scan_resources
515513
resources = scan_resources(src_paths, toolchain, inc_dirs=inc_dirs)
514+
if (hasattr(toolchain.target, "release_versions") and
515+
"5" not in toolchain.target.release_versions and
516+
"rtos" in toolchain.config.lib_config_data):
517+
raise NotSupportedException("Target does not support mbed OS 5")
516518

517519
# Change linker script if specified
518520
if linker_script is not None:

tools/make.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@
313313

314314
except KeyboardInterrupt, e:
315315
print "\n[CTRL+c] exit"
316-
except NotSupportedException, e:
317-
print "\nNot supported for selected target"
316+
except NotSupportedException as e:
317+
print "\nCould not compile for %s: %s" % (mcu, str(e))
318318
except Exception,e:
319319
if options.verbose:
320320
import traceback

tools/test/build_api/build_api_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_build_project_app_config(self, mock_prepare_toolchain, mock_exists, _,
131131
mock_exists.return_value = False
132132
mock_prepare_toolchain().link_program.return_value = 1, 2
133133
mock_prepare_toolchain().config = namedtuple(
134-
"Config", "has_regions name")(None, None)
134+
"Config", "has_regions name lib_config_data")(None, None, {})
135135

136136
build_project(self.src_paths, self.build_path, self.target,
137137
self.toolchain_name, app_config=app_config)
@@ -160,7 +160,7 @@ def test_build_project_no_app_config(self, mock_prepare_toolchain, mock_exists,
160160
# Needed for the unpacking of the returned value
161161
mock_prepare_toolchain().link_program.return_value = 1, 2
162162
mock_prepare_toolchain().config = namedtuple(
163-
"Config", "has_regions name")(None, None)
163+
"Config", "has_regions name lib_config_data")(None, None, {})
164164

165165
build_project(self.src_paths, self.build_path, self.target,
166166
self.toolchain_name)

0 commit comments

Comments
 (0)