Skip to content

Commit b9557ae

Browse files
authored
Merge pull request #3587 from bridadan/fix_build_script_toolchain_check
Fixing toolchain executable not found error for build.py
2 parents 2c3d65b + 938ac93 commit b9557ae

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

tools/build.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,17 @@
211211
successes = []
212212
skipped = []
213213

214-
# CPPCHECK code validation
215-
if options.cppcheck_validation:
216-
for toolchain in toolchains:
217-
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
218-
search_path = TOOLCHAIN_PATHS[toolchain] or "No path set"
219-
args_error(parser, "Could not find executable for %s.\n"
220-
"Currently set search path: %s"
221-
% (toolchain, search_path))
222-
for target in targets:
214+
for toolchain in toolchains:
215+
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
216+
search_path = TOOLCHAIN_PATHS[toolchain] or "No path set"
217+
args_error(parser, "Could not find executable for %s.\n"
218+
"Currently set search path: %s"
219+
% (toolchain, search_path))
220+
221+
for toolchain in toolchains:
222+
for target in targets:
223+
# CPPCHECK code validation
224+
if options.cppcheck_validation:
223225
try:
224226
mcu = TARGET_MAP[target]
225227
# CMSIS and MBED libs analysis
@@ -244,10 +246,8 @@
244246
traceback.print_exc(file=sys.stdout)
245247
sys.exit(1)
246248
print e
247-
else:
248-
# Build
249-
for toolchain in toolchains:
250-
for target in targets:
249+
else:
250+
# Build
251251
tt_id = "%s::%s" % (toolchain, target)
252252
if toolchain not in TARGET_MAP[target].supported_toolchains:
253253
# Log this later
@@ -299,6 +299,7 @@
299299
failures.append(tt_id)
300300
print e
301301

302+
302303
# Write summary of the builds
303304
print
304305
print "Completed in: (%.2f)s" % (time() - start)

0 commit comments

Comments
 (0)