Skip to content

Commit 6315982

Browse files
committed
Add clang preset
1 parent 6e9f25c commit 6315982

File tree

4 files changed

+45
-8
lines changed

4 files changed

+45
-8
lines changed

.github/workflows/linux.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,14 @@ jobs:
3030
run: ./mktree.oci check --interactive=false -j$(nproc)
3131
working-directory: ./tests
3232

33+
build_clang:
34+
runs-on: ubuntu-24.04
35+
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Build with Clang
39+
run: ./mktree.oci build --preset ci-clang
40+
working-directory: ./tests
41+
3342
env:
3443
MKTREE_ENGINE: docker

CMakePresets.json

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
"version": 10,
33
"configurePresets": [
44
{
5-
"name": "ci-gcc",
6-
"displayName": "CI config using GNU C compiler",
5+
"name": "ci-default",
6+
"displayName": "Default CI config",
77
"cacheVariables": {
8-
"ENABLE_WERROR": "ON",
9-
"ENABLE_ASAN": "ON",
10-
"ENABLE_UBSAN": "ON",
118
"ENABLE_BDB_RO": "ON",
129
"WITH_FSVERITY": "ON",
1310
"WITH_IMAEVM": "ON",
@@ -19,6 +16,28 @@
1916
"CFLAGS": "-Og -g",
2017
"CXXFLAGS": "-Og -g"
2118
}
19+
},
20+
{
21+
"name": "ci-gcc",
22+
"inherits": "ci-default",
23+
"displayName": "GNU C based CI config",
24+
"cacheVariables": {
25+
"ENABLE_WERROR": "ON",
26+
"ENABLE_ASAN": "ON",
27+
"ENABLE_UBSAN": "ON"
28+
}
29+
},
30+
{
31+
"name": "ci-clang",
32+
"inherits": "ci-default",
33+
"displayName": "Clang based CI config",
34+
"cacheVariables": {
35+
"CMAKE_C_COMPILER": "clang",
36+
"CMAKE_CXX_COMPILER": "clang++",
37+
"ENABLE_WERROR": "OFF",
38+
"ENABLE_ASAN": "OFF",
39+
"ENABLE_UBSAN": "OFF"
40+
}
2241
}
2342
]
2443
}

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=ci-gcc
9699

97100
WORKDIR /srv/rpm
98101
COPY . .
99102

100103
WORKDIR /srv/build
101-
RUN cmake --preset ci-gcc ../rpm
104+
RUN cmake --preset ${CMAKE_PRESET} ../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)