1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 05:26:58 +08:00

ci: add an image for Debian 10

This image is primarily for the include-what-you-use build.
This commit is contained in:
Ben Boeckel
2020-04-27 16:00:03 -04:00
parent 68903ae238
commit 6af91c7c4d
3 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
FROM debian:10 as iwyu-build
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_iwyu.sh /root/install_iwyu.sh
RUN sh /root/install_iwyu.sh
FROM debian:10
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_deps.sh /root/install_deps.sh
RUN sh /root/install_deps.sh
COPY --from=iwyu-build /root/iwyu.tar.gz /root/iwyu.tar.gz
RUN tar -C / -xf /root/iwyu.tar.gz
RUN ln -s /usr/lib/llvm-6.0/bin/include-what-you-use /usr/bin/include-what-you-use-6.0

View File

@@ -0,0 +1,22 @@
#!/bin/sh
set -e
apt-get update
# Install build requirements.
apt-get install -y \
libssl-dev
# Install development tools.
apt-get install -y \
g++ \
curl \
git
# Install iwyu runtime deps.
apt-get install -y \
clang-6.0 \
libncurses6
apt-get clean

View File

@@ -0,0 +1,32 @@
#!/bin/sh
set -e
# Install development tools.
apt-get update
apt-get install -y \
clang-6.0 \
libclang-6.0-dev \
llvm-6.0-dev \
libz-dev \
g++ \
cmake \
ninja-build \
git
cd /root
git clone "https://github.com/include-what-you-use/include-what-you-use.git"
cd include-what-you-use
readonly llvm_version="$( clang-6.0 --version | head -n1 | cut -d' ' -f3 | cut -d. -f-2 )"
git checkout "clang_$llvm_version"
mkdir build
cd build
cmake -GNinja \
-DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$llvm_version" \
"-DIWYU_LLVM_ROOT_PATH=/usr/lib/llvm-$llvm_version" \
..
ninja
DESTDIR=/root/iwyu-destdir ninja install
tar -C /root/iwyu-destdir -cf /root/iwyu.tar.gz .