From afa83972060bdc7d399f0a0205e044ffe3b6609f Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 12 Apr 2021 13:44:13 +0000 Subject: [PATCH] chore: Install clang-format-11 as minimum --- install_llvm.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/install_llvm.sh b/install_llvm.sh index 0a13af5..da1e3c5 100755 --- a/install_llvm.sh +++ b/install_llvm.sh @@ -22,11 +22,18 @@ apt-get install -y --no-install-recommends \ "libc++abi-$LLVM_VERSION-dev" \ "libc++1-$LLVM_VERSION" -# Explicitly use clang-format-11 because of changes between 10 and 11 -apt-get install -y --no-install-recommends \ - "clang-format-11" - update-alternatives --install /usr/bin/clang clang "/usr/bin/clang-$LLVM_VERSION" 100 update-alternatives --install /usr/bin/clang++ clang++ "/usr/bin/clang++-$LLVM_VERSION" 100 update-alternatives --install /usr/bin/llvm-config llvm-config "/usr/bin/llvm-config-$LLVM_VERSION" 100 -update-alternatives --install /usr/bin/clang-format clang-format "/usr/bin/clang-format-11" 100 +update-alternatives --install /usr/bin/llvm-objdump llvm-objdump "/usr/bin/llvm-objdump-$LLVM_VERSION" 100 + +# Explicitly use at least clang-format-11 to format source because of changes between 10 and 11 +if [[ "$LLVM_VERSION" -ge 11 ]]; then + apt-get install -y --no-install-recommends \ + "clang-format-$LLVM_VERSION" + update-alternatives --install /usr/bin/clang-format clang-format "/usr/bin/clang-format-$LLVM_VERSION" 100 +else + apt-get install -y --no-install-recommends \ + "clang-format-11" + update-alternatives --install /usr/bin/clang-format clang-format "/usr/bin/clang-format-11" 100 +fi