kaleidoscope-builder: Allow easily selecting a compiler

While we do not currently support any other compiler than the gcc suite, we
eventually want to. Meanwhile, we also want to be able to easily switch to gcc
when that's not the default on the system.

For this reason, we introduce `KALEIDOSCOPE_COMPILER`, which can be set to `gcc`
or `clang`, and `kaleidoscope-builder` will then set up the appropriate
basenames.

This, combined with the previous change, allows us to easily select gcc for
virtual builds, even when clang is the default on the system.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/851/head
Gergely Nagy 4 years ago
parent 4f08df1c76
commit 56a729260f
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -35,6 +35,23 @@ if [ -z "${FQBN}" ]; then
FQBN="${FQBN:-keyboardio:avr:${BOARD}}" FQBN="${FQBN:-keyboardio:avr:${BOARD}}"
fi fi
if [ ! -z "${KALEIDOSCOPE_COMPILER}" ]; then
case "${KALEIDOSCOPE_COMPILER}" in
gnu|gcc|g++)
C_COMPILER_BASENAME=gcc
CXX_COMPILER_BASENAME=g++
;;
clang)
C_COMPILER_BASENAME=clang
CXX_COMPILER_BASENAME=clang++
;;
*)
echo "Unsupported compiler: ${KALEIDOSCOPE_COMPILER}" >&2
exit 1
;;
esac
fi
######## ########
######## Host OS specific commands ######## Host OS specific commands
######## ########

Loading…
Cancel
Save