make /bin/build.sh use clang if it can find it by default

This commit is contained in:
veclav talica 2024-10-18 20:33:46 +03:00
parent 024f17de91
commit 73b6ab047d

View File

@ -5,8 +5,13 @@ if [ -x "$(command -v ninja)" ]; then
generator="-G Ninja" generator="-G Ninja"
fi fi
if [ "$1" = "web" ]; then # check whether clang is around (it's just better)
emcmake cmake $generator -B .build-web "${@:2}" && cmake --build .build-web --parallel if [ -x "$(command -v clang)" ]; then
else cc="-DCMAKE_C_COMPILER=clang"
cmake $generator -B .build "$@" && cmake --build .build --parallel fi
if [ "$1" = "web" ]; then
emcmake cmake $generator $cc -B .build-web "${@:2}" && cmake --build .build-web --parallel
else
cmake $generator $cc -B .build "$@" && cmake --build .build --parallel
fi fi