Skip to content

Linux-Clang Build

Linux-Clang Build #3

name: Linux-Clang Build
on:
workflow_dispatch:
jobs:
build-linux-clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download submodules
run: git submodule update --init --recursive
- name: Maybe useful update
run: sudo apt update
- name: Cache APT Packages - Clang, Ninja, GLFW-needed ones
uses: awalsh128/[email protected]
with:
packages: clang llvm lld clang-tools libclang-dev build-essential ninja-build libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config libxkbcommon-dev libwayland-dev
execute_install_scripts: true # run install scripts
- name: Cache CMake and Build Files
uses: actions/cache@v3
with:
path: |
~/.cmake/packages
build
key: clang-${{ github.ref }}-${{ github.sha }}
restore-keys: |
clang-${{ github.ref }}
- name: Install Clang LTO plugin (LLVMgold)
run: |
sudo apt-get install llvm-18-tools
- name: Configure CMake to build examples
run: |
cd examples
mkdir -p build
cd build
cmake -G "Ninja" .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_LINKER=lld \
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" # just cause i want
- name: Build
run: |
cd build
cmake --build . --verbose