Skip to content

linux-clang + windows-mingw workflows #1

linux-clang + windows-mingw workflows

linux-clang + windows-mingw workflows #1

name: Build with Linux Clang
on:
workflow_dispatch:
push:
branches:
- modules
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 ninja-build pkg-config build-essential libxkbcommon-dev libwayland-client0.1-0 libwayland-cursor0 libwayland-egl1.0-0 wayland-protocols libwayland-dev libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
execute_install_scripts: true # optional, set to true if you need to 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-12-tools
- name: Configure CMake
run: |
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 -flto" # Enable LTO and link using LLD
- name: Build
run: |
cd build
cmake --build . --verbose