@@ -79,26 +79,13 @@ RUN apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \
7979 doxygen graphviz ccache cppcheck xz-utils
8080
8181# Install include-what-you-use
82- ENV IWYU /home/iwyu
83- ENV IWYU_BUILD ${IWYU}/build
84- ENV IWYU_SRC ${IWYU}/include-what-you-use
85- RUN mkdir -p ${IWYU_BUILD} && \
86- git clone --branch clang_${LLVM_VER} \
87- https://github.com/include-what-you-use/include-what-you-use.git \
88- ${IWYU_SRC}
89- RUN CC=clang-${LLVM_VER} CXX=clang++-${LLVM_VER} cmake -S ${IWYU_SRC} \
90- -B ${IWYU_BUILD} \
91- -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-${LLVM_VER} && \
92- cmake --build ${IWYU_BUILD} -j && \
93- cmake --install ${IWYU_BUILD}
94-
95- # Per https://github.com/include-what-you-use/include-what-you-use#how-to-install:
96- # `You need to copy the Clang include directory to the expected location before
97- # running (similarly, use include-what-you-use -print-resource-dir to learn
98- # exactly where IWYU wants the headers).`
99- RUN mkdir -p $(include-what-you-use -print-resource-dir 2>/dev/null)
100- RUN ln -s $(readlink -f /usr/lib/clang/${LLVM_VER}/include) \
101- $(include-what-you-use -print-resource-dir 2>/dev/null)/include
82+ RUN mkdir iwyu && cd iwyu \
83+ && git clone --branch clang_${LLVM_VER} https://github.com/include-what-you-use/include-what-you-use.git \
84+ && mkdir build && cd build \
85+ && cmake -G "Ninja" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-${LLVM_VER} ../include-what-you-use \
86+ && sudo ninja install \
87+ && cd ../.. \
88+ && rm -rf iwyu
10289
10390# # Cleanup cached apt data we don't need anymore
10491RUN apt-get autoremove -y && apt-get clean && \
0 commit comments