diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-05-04 23:17:53 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-05-04 23:17:53 +0200 |
commit | c40eb0b2d6966760899d1d0c2743770ea130ff09 (patch) | |
tree | 52054feaefead4543f4f84c718d11119ecf1f7fb | |
parent | 365c0ddd1a5fbf461a13cfdb7a6c0a7f5d4390c0 (diff) |
build: Detect available toolchains.
-rw-r--r-- | build/scons_tools/tool_selectmcu.py | 10 |
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( |