File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM ubuntu:latest
22
3+ RUN mkdir /opt/source
4+ RUN mkdir /opt/workdir
5+
36RUN apt-get -y update
47RUN apt-get -y install \
58 clang++-22 \
@@ -22,12 +25,23 @@ RUN rustup component add --toolchain "1.96.1-x86_64-unknown-linux-gnu" rust-src
2225ENV PATH="/root/.cargo/bin:${PATH}"
2326ENV RUST_BACKTRACE=full
2427
25- WORKDIR /opt/workdir
28+ COPY cpp2rust /opt/source/cpp2rust
29+ COPY libc-dep /opt/source/libc-dep
30+ COPY libcc2rs /opt/source/libcc2rs
31+ COPY libcc2rs-macros /opt/source/libcc2rs-macros
32+ COPY cmake /opt/source/cmake
33+ COPY tests /opt/source/tests
34+
35+ COPY CMakeLists.txt /opt/source/CMakeLists.txt
2636
27- CMD cmake \
37+ WORKDIR /opt/source
38+
39+ RUN cmake \
2840 -G Ninja \
2941 -B build \
3042 -D CMAKE_C_COMPILER="$(which clang-22)" \
3143 -D CMAKE_CXX_COMPILER="$(which clang++-22)" \
3244 .; \
3345 cmake --build build -j$(nproc)
46+
47+ WORKDIR /opt/workdir
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ services:
55 context : .
66 volumes :
77 - " $PWD:/opt/workdir"
8-
8+ entrypoint : ./misc/containers/build.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
2+
3+ # DO NOT RUN!
4+ # This image is intended to be used from an OCI compose file.
5+
6+ set -eo pipefail
7+
8+ if [ -d " /opt/workdir/build" ]; then
9+ echo " Build directory already exists, moving it."
10+ if [ -d " /opt/workdir/build-backup" ]; then
11+ echo " Build backup directory already exists, exiting as error."
12+ exit 1
13+ else
14+ mv /opt/workdir/build /opt/workdir/build-backup
15+ fi
16+ fi
17+
18+ cmake \
19+ -G Ninja \
20+ -B build \
21+ -D CMAKE_C_COMPILER=" $( which clang-22) " \
22+ -D CMAKE_CXX_COMPILER=" $( which clang++-22) " \
23+ .
24+
25+ cmake --build build " -j$( nproc) "
You can’t perform that action at this time.
0 commit comments