1
0
forked from bonsai/harakit

tests: cc-compat.sh: fixed bug when all tested compilers aren’t present

This commit is contained in:
Emma Tebibyte 2023-12-24 17:31:17 -07:00
parent ef1416cd42
commit 68b296e963
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270

View File

@ -12,18 +12,22 @@ set -e
if ! ls GNUmakefile >/dev/null 2>&1 if ! ls GNUmakefile >/dev/null 2>&1
then then
printf '%s: Run this script in the root of the project.\n' "$0" 1>&2 printf '%s: Run this script in the root of the project.\n' "$0" 1>&2
exit 1 exit 64 # sysexits.h(3) EX_USAGE
fi fi
make clean make clean
for CC in cc\ for CC in cc \
clang \ clang \
gcc \ gcc \
tcc \ tcc \
'zig cc' 'zig cc'
do do
export CC export CC
command -v "$(printf '%s\n' "$CC" | cut -d ' ' -f1)" >/dev/null 2>&1 \
|| continue
printf '%s: %s: Testing build.\n' "$0" "$CC" printf '%s: %s: Testing build.\n' "$0" "$CC"
make CC="$CC" && printf '%s: Build successful.\n' "$0" make CC="$CC" && printf '%s: Build successful.\n' "$0"