From b7ffb2bde74900613c8e6c68e033c6ce8cf38364 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 16 May 2022 10:15:43 +0200 Subject: [PATCH] Meta: Validate explicitly set TOOLCHAIN in `serenity.sh` Previously, `serenity.sh rebuild-toolchain x86_64 clang` would simply start building GCC instead and call it a day. With this change, if a toolchain is passed as an argument, it is validated if it is either "GNU" or "Clang" and exits with an error otherwise. The `TOOLCHAIN` value defaults to the `SERENITY_TOOLCHAIN` environment variable if not provided explicitly. --- Meta/serenity.sh | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Meta/serenity.sh b/Meta/serenity.sh index c3fe97e30b4..cf2858e785a 100755 --- a/Meta/serenity.sh +++ b/Meta/serenity.sh @@ -8,7 +8,7 @@ print_help() { cat <&2 echo "ERROR: unknown toolchain '${TOOLCHAIN_TYPE}'." + exit 1 +fi +CMAKE_ARGS+=( "-DSERENITY_TOOLCHAIN=$TOOLCHAIN_TYPE" ) CMD_ARGS=( "$@" )