-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 1.83 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (31 loc) · 1.83 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
FROM debian:bookworm
# LLVM 7
RUN apt update && apt install -y lsb-release wget software-properties-common gnupg
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
RUN add-apt-repository -y 'deb http://apt.llvm.org/unstable/ llvm-toolchain main'
RUN add-apt-repository -y 'deb http://apt.llvm.org/unstable/ llvm-toolchain main'
RUN apt update && apt install -y clang-17 clang-tools-17 libc++-17-dev libc++abi-17-dev
# replace broken symlinks
# /usr/lib/clang/17/include -> ../../llvm-17/lib/clang/17.0.0/include
# /usr/lib/clang/17/lib -> ../../llvm-17/lib/clang/17.0.0/lib
RUN cd /usr/lib/clang/17 && ln -s ../../llvm-17/lib/clang/17/include include --force
RUN cd /usr/lib/clang/17 && ln -s ../../llvm-17/lib/clang/17/lib lib --force
# CMake 3.26
RUN apt install wget && wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh
RUN bash ./cmake-3.26.4-linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license
# Extra Packages
RUN apt update && apt install -y python3-pip ninja-build pipx
# Patch Conan settings
RUN pipx run conan==1.60.0 config init
RUN apt install -y jq
RUN pipx run yq '.compiler.clang.version += [ "17" ]' /root/.conan/settings.yml -i -Y
# Build Conan packages
WORKDIR cmake-cpp-modules-template
COPY conanfile.txt profile-clang-debian.txt /cmake-cpp-modules-template/
RUN mkdir -p build/clang
RUN pipx run conan==1.60.0 install . -g cmake_multi -if build/clang -s build_type=Release --build=missing --profile=profile-clang-debian.txt
# Build Project
COPY . /cmake-cpp-modules-template
RUN cmake -B build/clang -G "Ninja Multi-Config" -DCMAKE_CXX_COMPILER=/usr/bin/clang++-17 -DCONAN_COMPILER=clang -DCONAN_COMPILER_VERSION=17
RUN cmake --build build/clang --config Release -j8
CMD ctest --test-dir build/clang -C Release --output-on-failure