summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/scons_tools/tool_selectmcu.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/build/scons_tools/tool_selectmcu.py b/build/scons_tools/tool_selectmcu.py
index 7c011c3..e99df5e 100644
--- a/build/scons_tools/tool_selectmcu.py
+++ b/build/scons_tools/tool_selectmcu.py
@@ -8,8 +8,16 @@ def SelectMCU(env, mcu, variant_dir = None):
print('Unknown MCU: %s' % mcu)
Exit(1)
+ detected_gcc = env.Detect([f'{toolchain}-gcc' for toolchain in spec['toolchains']])
+ if detected_gcc is None:
+ print('Couldn\'t find a suitable toolchain.')
+ print('Toolchains searched for:')
+ for toolchain in spec['toolchains']:
+ print(f' * {toolchain}')
+ Exit(1)
+
env.SetDefault(
- TOOLCHAIN = '%s-' % spec['toolchains'][0],
+ TOOLCHAIN = detected_gcc[:-3],
)
env.Replace(