Skip to content

Commit fea7069

Browse files
committed
Add clang preset
1 parent 77b3a84 commit fea7069

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

.github/workflows/linux.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v3
21-
- name: Build the Fedora testing environment
21+
- name: Build the Fedora testing environment (clang)
22+
run: ./mktree.oci build --preset dev-clang
23+
working-directory: ./tests
24+
- name: Build the Fedora testing environment (gcc)
25+
# This replaces the previous clang based image
2226
run: ./mktree.oci build
2327
working-directory: ./tests
2428
- name: Fix kernel mmap rnd bits

CMakePresets.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@
1818
"CFLAGS": "-Og -g",
1919
"CXXFLAGS": "-Og -g"
2020
}
21+
},
22+
{
23+
"name": "dev-gcc",
24+
"inherits": "dev",
25+
"displayName": "GNU C based development",
26+
"cacheVariables": {
27+
"CMAKE_C_COMPILER": "gcc",
28+
"CMAKE_CXX_COMPILER": "g++",
29+
}
30+
},
31+
{
32+
"name": "dev-clang",
33+
"inherits": "dev",
34+
"displayName": "Clang based development",
35+
"cacheVariables": {
36+
"CMAKE_C_COMPILER": "clang",
37+
"CMAKE_CXX_COMPILER": "clang++",
38+
"ENABLE_WERROR": "OFF",
39+
"ENABLE_ASAN": "OFF",
40+
"ENABLE_UBSAN": "OFF"
41+
}
2142
}
2243
]
2344
}

tests/Dockerfile.fedora

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ RUN dnf -y install \
5858
sequoia-sq \
5959
libasan \
6060
libubsan \
61-
nss-altfiles
61+
nss-altfiles \
62+
clang \
63+
libomp-devel
6264
# If updates to specific packages are needed, do it here
6365
# RUN dnf -y --enablerepo=updates install ...
6466

@@ -93,12 +95,13 @@ WORKDIR /
9395
CMD /bin/bash
9496

9597
FROM base AS full
98+
ARG CMAKE_PRESET=dev-gcc
9699

97100
WORKDIR /srv/rpm
98101
COPY . .
99102

100103
WORKDIR /srv/build
101-
RUN cmake --preset dev -DMKTREE_BACKEND=rootfs ../rpm
104+
RUN cmake --preset ${CMAKE_PRESET} -DMKTREE_BACKEND=rootfs ../rpm
102105
RUN make -j$(nproc) tree
103106

104107
RUN rm -rf /srv/{rpm,build}

tests/mktree.oci

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ case $CMD in
8888
$PODMAN commit -q $id --iidfile=$IID_FILE
8989
else
9090
# Standalone build
91-
$PODMAN build --target full --iidfile=$IID_FILE $ARGS
91+
opts=
92+
case "$1" in
93+
--preset)
94+
opts="--build-arg CMAKE_PRESET=$2"
95+
;;
96+
esac
97+
$PODMAN build --target full --iidfile=$IID_FILE $opts $ARGS
9298
fi
9399
;;
94100
check)

0 commit comments

Comments
 (0)