2222 sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" -y
2323 sudo apt update
2424 sudo apt install -y clang-15 clang-16 clang-17 clang-18
25- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-15 1
26- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-15 1
27- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-16 1
28- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-16 1
29- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-17 1
30- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-17 1
31- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-18 1
32- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-18 1
3325
3426 - name : check compiler versions
3527 run : |
@@ -40,36 +32,24 @@ jobs:
4032
4133 - name : build and run test with clang 15
4234 run : |
43- sudo update-alternatives --set gcc /usr/bin/clang-15
44- sudo update-alternatives --set g++ /usr/bin/clang++-15
45- cmake . -B build-clang-15
46- cmake --build ./build-clang-15 -j8
47- cd ./build-clang-15
48- ctest -j8
35+ cmake -B build-clang-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15
36+ cmake --build build-clang-15 -j
37+ ctest --test-dir build-clang-15 -j
4938
5039 - name : build and run test with clang 16
5140 run : |
52- sudo update-alternatives --set gcc /usr/bin/clang-16
53- sudo update-alternatives --set g++ /usr/bin/clang++-16
54- cmake . -B build-clang-16
55- cmake --build ./build-clang-16 -j8
56- cd ./build-clang-16
57- ctest -j8
41+ cmake -B build-clang-16 -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16
42+ cmake --build build-clang-16 -j
43+ ctest --test-dir build-clang-16 -j
5844
5945 - name : build and run test with clang 17
6046 run : |
61- sudo update-alternatives --set gcc /usr/bin/clang-17
62- sudo update-alternatives --set g++ /usr/bin/clang++-17
63- cmake . -B build-clang-17
64- cmake --build ./build-clang-17 -j8
65- cd ./build-clang-17
66- ctest -j8
47+ cmake -B build-clang-17 -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17
48+ cmake --build build-clang-17 -j
49+ ctest --test-dir build-clang-17 -j
6750
6851 - name : build and run test with clang 18
6952 run : |
70- sudo update-alternatives --set gcc /usr/bin/clang-18
71- sudo update-alternatives --set g++ /usr/bin/clang++-18
72- cmake . -B build-clang-18
73- cmake --build ./build-clang-18 -j8
74- cd ./build-clang-18
75- ctest -j8
53+ cmake -B build-clang-18 -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18
54+ cmake --build build-clang-18 -j
55+ ctest --test-dir build-clang-18 -j
0 commit comments