55FROM ubuntu:22.10 as cpp-docker-common
66
77ARG DEBIAN_FRONTEND=noninteractive
8+ ARG CLANG_COMPILER_VERSION=15
9+ ARG CMAKE_VERSION=3.26.3
810ENV PATH="${PATH}:/cmake-3.26.3-linux-x86_64/bin/:"
911
1012RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install --fix-missing \
11- apturl \
1213 binutils \
1314 build-essential \
1415 bzip2 \
@@ -27,13 +28,23 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install --fix-missin
2728 tar \
2829 valgrind \
2930 wget
30- RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-linux-x86_64.sh \
31- && chmod +x cmake-3.26.3-linux-x86_64.sh \
32- && ./cmake-3.26.3-linux-x86_64.sh --include-subdir --skip-license \
33- && rm cmake-3.26.3-linux-x86_64.sh
31+
32+ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh \
33+ && chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh \
34+ && ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --include-subdir --skip-license \
35+ && rm cmake-${CMAKE_VERSION}-linux-x86_64.sh
3436RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
35- RUN apt-get -y install clang-format clang-tidy clang-15
36- RUN apt-get autoremove -y && apt-get clean
37+
38+ RUN apt-get -y install --fix-missing clang-format clang-tidy clang-${PATH} llvm-${PATH} llvm-${PATH}-dev libclang-${PATH}-dev \
39+ && apt-get autoremove -y && apt-get clean
40+
41+ RUN mkdir iwyu && cd iwyu \
42+ && git clone --branch clang_${PATH} https://github.com/include-what-you-use/include-what-you-use.git \
43+ && mkdir build && cd build \
44+ && cmake -G "Ninja" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-${PATH} ../include-what-you-use \
45+ && sudo ninja install \
46+ && cd ../.. \
47+ && rm -rf iwyu
3748
3849
3950# =================================
0 commit comments