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 \
1516 cppcheck \
1617 ccache \
1718 doxygen \
1819 graphviz \
20+ git \
1921 lsb-release \
2022 ninja-build \
2123 python3 \
@@ -27,13 +29,23 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install --fix-missin
2729 tar \
2830 valgrind \
2931 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
32+
33+ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh \
34+ && chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh \
35+ && ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --include-subdir --skip-license \
36+ && rm cmake-${CMAKE_VERSION}-linux-x86_64.sh
3437RUN 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
38+
39+ RUN apt-get -y install --fix-missing clang-format clang-tidy clang-${CLANG_COMPILER_VERSION} llvm-${CLANG_COMPILER_VERSION} llvm-${CLANG_COMPILER_VERSION}-dev libclang-${CLANG_COMPILER_VERSION}-dev \
40+ && apt-get autoremove -y && apt-get clean
41+
42+ RUN mkdir iwyu && cd iwyu \
43+ && git clone --branch clang_${CLANG_COMPILER_VERSION} https://github.com/include-what-you-use/include-what-you-use.git \
44+ && mkdir build && cd build \
45+ && cmake -G "Ninja" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-${CLANG_COMPILER_VERSION} ../include-what-you-use \
46+ && sudo ninja install \
47+ && cd ../.. \
48+ && rm -rf iwyu
3749
3850
3951# =================================
0 commit comments