mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:57:45 +00:00
Meta: Use clang-format from the Clang toolchain if available
This commit is contained in:
parent
01b31d9858
commit
d6a735fe62
1 changed files with 3 additions and 0 deletions
|
@ -26,9 +26,12 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( ${#files[@]} )); then
|
if (( ${#files[@]} )); then
|
||||||
|
TOOLCHAIN_DIR=Toolchain/Local/clang/bin
|
||||||
CLANG_FORMAT=false
|
CLANG_FORMAT=false
|
||||||
if command -v clang-format-14 >/dev/null 2>&1 ; then
|
if command -v clang-format-14 >/dev/null 2>&1 ; then
|
||||||
CLANG_FORMAT=clang-format-14
|
CLANG_FORMAT=clang-format-14
|
||||||
|
elif command -v $TOOLCHAIN_DIR/clang-format >/dev/null 2>&1 && $TOOLCHAIN_DIR/clang-format --version | grep -qF ' 14.' ; then
|
||||||
|
CLANG_FORMAT=$TOOLCHAIN_DIR/clang-format
|
||||||
elif command -v clang-format >/dev/null 2>&1 ; then
|
elif command -v clang-format >/dev/null 2>&1 ; then
|
||||||
CLANG_FORMAT=clang-format
|
CLANG_FORMAT=clang-format
|
||||||
if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) < 14) exit 1; }'; then
|
if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) < 14) exit 1; }'; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue