summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2022-05-04 23:17:53 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2022-05-04 23:17:53 +0200
commitc40eb0b2d6966760899d1d0c2743770ea130ff09 (patch)
tree52054feaefead4543f4f84c718d11119ecf1f7fb /build
parent365c0ddd1a5fbf461a13cfdb7a6c0a7f5d4390c0 (diff)
build: Detect available toolchains.
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(