aboutsummaryrefslogtreecommitdiff
path: root/docker/debian-dev/bootstrap/extra/setup-llvm.bash
blob: 48dde8684f63a1da786f47084bbd1578b5c35f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env bash

set -e

LLVM_VERSION=18

. /bootstrap/func.bash

if is_true "$CRUPEST_DEBIAN_DEV_IN_CHINA"; then
    base_url=https://mirrors.tuna.tsinghua.edu.cn/llvm-apt
else
    base_url=https://apt.llvm.org
fi

wget "$base_url/llvm.sh"
chmod +x llvm.sh
./llvm.sh $LLVM_VERSION all -m "$base_url"
rm llvm.sh

update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100 \
    --slave /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION \
    --slave /usr/bin/clangd clangd /usr/bin/clangd-$LLVM_VERSION \
    --slave /usr/bin/clang-format clang-format /usr/bin/clang-format-$LLVM_VERSION \
    --slave /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VERSION \
    --slave /usr/bin/lldb lldb /usr/bin/lldb-$LLVM_VERSION \
    --slave /usr/bin/lld lld /usr/bin/lld-$LLVM_VERSION