Skip to content

Why cmake wont use clang-17? #6

Why cmake wont use clang-17?

Why cmake wont use clang-17? #6

Workflow file for this run

name: compile_time_regexp.h tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Debug]
os: [ubuntu-latest]
cpp_compiler: [g++, clang++]
include:
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
steps:
- uses: actions/checkout@v3
- name: Install LLVM 17
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.cpp_compiler == 'clang++')}}
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100
sudo update-alternatives --install /usr/bin/c++ clang++ /usr/bin/clang++-17 100
sudo update-alternatives --install /usr/bin/cc clang /usr/bin/clang-17 100
- name: Install GCC 13
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.cpp_compiler == 'g++')}}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
sudo apt update
sudo apt install g++-13 gcc-13 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: >
CC=${{ matrix.c_compiler }}
CXX=${{ matrix.c_compiler }}
cmake -B . -S ${{ github.workspace }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DBUILD_TESTS=1
- name: Build Test
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config ${{ matrix.build_type }} --target tests
- name: Run mTest
working-directory: ${{runner.workspace}}/build
run: ctest --test-dir tests --config ${{ matrix.build_type }}