From 25826566c5f3316d4712a736b465ffd1329219cc Mon Sep 17 00:00:00 2001 From: Mathew Benson Date: Mon, 16 Mar 2026 19:46:49 +0300 Subject: [PATCH] Remove LLVM 20 limitation - clang-format ignore on CoroutineScheduler.h and VulkanDevice.h for operator bool() - update ubuntu CI workflow to use version 21 as it tends to be behind in its inbuild version --- .github/workflows/job-cmakebuild-linux.yml | 11 ++++++----- Scripts/Shared.ps1 | 1 + ZEngine/ZEngine/Core/CoroutineScheduler.h | 3 ++- ZEngine/ZEngine/Hardwares/VulkanDevice.h | 6 ++++-- repoConfiguration.json | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/job-cmakebuild-linux.yml b/.github/workflows/job-cmakebuild-linux.yml index 04227d86..1a1e4e86 100644 --- a/.github/workflows/job-cmakebuild-linux.yml +++ b/.github/workflows/job-cmakebuild-linux.yml @@ -25,16 +25,17 @@ jobs: - name: Register the Microsoft repository GPG keys run: sudo dpkg -i packages-microsoft-prod.deb - - name: Install LLVM-20 + - name: Install LLVM-21 run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 20 + sudo ./llvm.sh 21 - - name: Update the list of packages after we added packages.microsoft.com + - name: Update the list of packages run: sudo apt-get update - - name: Install development library - run: sudo apt-get install libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev cmake apt-transport-https software-properties-common gcc g++ powershell clang-format-20 libwayland-dev libxkbcommon-dev dotnet-sdk-8.0 + + - name: Install Dependencies + run: sudo apt-get install libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev cmake apt-transport-https software-properties-common gcc g++ powershell clang-format-21 glslang-tools libwayland-dev libxkbcommon-dev - name: CMake Build run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} diff --git a/Scripts/Shared.ps1 b/Scripts/Shared.ps1 index f5b3f502..1ba48dd8 100644 --- a/Scripts/Shared.ps1 +++ b/Scripts/Shared.ps1 @@ -201,6 +201,7 @@ function Find-ClangFormat () { } if ($IsLinux) { '/usr/bin/clang-format' + '/usr/bin/clang-format-21' '/usr/bin/clang-format-20' } 'clang-format' diff --git a/ZEngine/ZEngine/Core/CoroutineScheduler.h b/ZEngine/ZEngine/Core/CoroutineScheduler.h index 6ffa8952..6f37c2d0 100644 --- a/ZEngine/ZEngine/Core/CoroutineScheduler.h +++ b/ZEngine/ZEngine/Core/CoroutineScheduler.h @@ -14,11 +14,12 @@ namespace ZEngine::Core ReadyCallback Ready = nullptr; ExecuteCallback Action = nullptr; - + // clang-format off operator bool() noexcept { return (Ready && Action); } + // clang-format on }; struct CoroutineScheduler diff --git a/ZEngine/ZEngine/Hardwares/VulkanDevice.h b/ZEngine/ZEngine/Hardwares/VulkanDevice.h index d75d0641..518b3618 100644 --- a/ZEngine/ZEngine/Hardwares/VulkanDevice.h +++ b/ZEngine/ZEngine/Hardwares/VulkanDevice.h @@ -76,11 +76,12 @@ namespace ZEngine::Hardwares BufferType Type = BufferType::UNKNOWN; VkBuffer Handle = VK_NULL_HANDLE; VmaAllocation Allocation = nullptr; - + // clang-format off operator bool() const { return (Handle != VK_NULL_HANDLE); } + // clang-format on }; struct BufferImage @@ -90,11 +91,12 @@ namespace ZEngine::Hardwares VkImageView ViewHandle{VK_NULL_HANDLE}; VkSampler Sampler{VK_NULL_HANDLE}; VmaAllocation Allocation{nullptr}; - + // clang-format off operator bool() const { return (Handle != VK_NULL_HANDLE); } + // clang-format on }; struct IGraphicBuffer diff --git a/repoConfiguration.json b/repoConfiguration.json index 4b53f257..28511529 100644 --- a/repoConfiguration.json +++ b/repoConfiguration.json @@ -24,7 +24,7 @@ }, "LLVM": { "Version": "20.1.7", - "MaximumVersion": "20.2.0" + "MaximumVersion": "22.0.0" } } }