Skip to content

Commit

Permalink
Install llvm repository for newer versions of clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
dave992 committed Aug 20, 2024
1 parent d23b9ad commit 1547277
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions industrial_ci/src/tests/clang_format_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ function run_clang_format_check() {
local clang_format_executable="clang-format${CLANG_FORMAT_VERSION:+-$CLANG_FORMAT_VERSION}"

ici_time_start install_clang_format

# Install llvm repository to install the correct clang version if not supported by default on the distro
if ! apt-cache search --names-only "$clang_format_executable" | grep -q "clang"; then
ici_install_pkgs_for_command wget wget
ici_apt_install lsb-release software-properties-common gnupg
ici_cmd wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
ici_cmd chmod +x /tmp/llvm.sh
ici_cmd /tmp/llvm.sh "$CLANG_FORMAT_VERSION"
fi

ici_apt_install git-core "$clang_format_executable"
ici_time_end # install_clang_format

Expand Down

0 comments on commit 1547277

Please sign in to comment.