From 139ce87a9e4f2ebc436babb4904deeb006e254de Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Wed, 15 Jul 2026 10:02:38 -0500 Subject: [PATCH 1/3] build: Update required CMake version to 3.28.3 Also removed workarounds for older CMake versions. --- CMakeLists.txt | 6 ++---- loader/CMakeLists.txt | 40 +++++++++++++++++----------------------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00795f2d4..1ce7a1d26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ~~~ -cmake_minimum_required(VERSION 3.22.1) +cmake_minimum_required(VERSION 3.28.3) project(VULKAN_LOADER VERSION 1.4.358 LANGUAGES C) @@ -58,7 +58,7 @@ if (DEFINED ${VulkanHeaders_VERSION} AND ${VulkanHeaders_VERSION} VERSION_GREATE endif() # Workaround AppleClang using the wrong headers when there are headers in /usr/local/include -if (CMAKE_C_COMPILER_ID STREQUAL AppleClang AND TARGET Vulkan::Headers AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.25) +if (CMAKE_C_COMPILER_ID STREQUAL AppleClang AND TARGET Vulkan::Headers) set_target_properties(Vulkan::Headers PROPERTIES SYSTEM OFF) endif() @@ -86,8 +86,6 @@ if (GIT_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git/HEAD") endif() endif() -# Enable IDE GUI folders. "Helper targets" that don't have interesting source code should set their FOLDER property to this -set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(LOADER_HELPER_FOLDER "Helper Targets") if(UNIX) diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 46f83d016..de5bc0db3 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -113,8 +113,6 @@ set(OPT_LOADER_SRCS dev_ext_trampoline.c phys_dev_ext.c) set(ASM_FAILURE_MSG "Support for unknown physical device and device functions is disabled due to missing the required assembly support code. \ To support unknown functions, assembly must be added for the platform.\n") -set(ARMASM_CMAKE_FAILURE_MSG "Support for unknown physical device and device functions is disabled due to the CMake version ${CMAKE_VERSION} \ -being older than 3.26. Please update CMake to version 3.26 or newer.\n") # Check for assembler support if(WIN32 AND NOT USE_GAS) @@ -136,27 +134,23 @@ if(WIN32 AND NOT USE_GAS) endif() if (USE_MASM) if(SYSTEM_PROCESSOR MATCHES "arm") - if(CMAKE_VERSION VERSION_LESS "3.26.0") - set(ASM_FAILURE_MSG ${ARMASM_CMAKE_FAILURE_MSG}) - else() - # CMake's MARMASM detection regex only matches "ARM64", so for arm64ec it - # picks the 32-bit armasm, and even on arm64 it leaves the compiler as a bare - # name that the check below can't run without the dev tools on PATH. Resolve - # armasm64 (next to the C compiler) and use its full path. Drop this once - # CMake's detection learns about ARM64EC. - if(SYSTEM_PROCESSOR MATCHES "arm64") - get_filename_component(MARMASM_TOOLCHAIN_DIR "${CMAKE_C_COMPILER}" DIRECTORY) - find_program(MARMASM_ARMASM64 NAMES armasm64 HINTS "${MARMASM_TOOLCHAIN_DIR}") - endif() - if(MARMASM_ARMASM64) - set(CMAKE_ASM_MARMASM_COMPILER "${MARMASM_ARMASM64}") - endif() - enable_language(ASM_MARMASM) - set(LOADER_ASM_DIALECT "MARMASM") - if(MARMASM_ARMASM64) - # enable_language resets the compiler to a bare name; re-assert the full path. - set(CMAKE_ASM_MARMASM_COMPILER "${MARMASM_ARMASM64}") - endif() + # CMake's MARMASM detection regex only matches "ARM64", so for arm64ec it + # picks the 32-bit armasm, and even on arm64 it leaves the compiler as a bare + # name that the check below can't run without the dev tools on PATH. Resolve + # armasm64 (next to the C compiler) and use its full path. Drop this once + # CMake's detection learns about ARM64EC. + if(SYSTEM_PROCESSOR MATCHES "arm64") + get_filename_component(MARMASM_TOOLCHAIN_DIR "${CMAKE_C_COMPILER}" DIRECTORY) + find_program(MARMASM_ARMASM64 NAMES armasm64 HINTS "${MARMASM_TOOLCHAIN_DIR}") + endif() + if(MARMASM_ARMASM64) + set(CMAKE_ASM_MARMASM_COMPILER "${MARMASM_ARMASM64}") + endif() + enable_language(ASM_MARMASM) + set(LOADER_ASM_DIALECT "MARMASM") + if(MARMASM_ARMASM64) + # enable_language resets the compiler to a bare name; re-assert the full path. + set(CMAKE_ASM_MARMASM_COMPILER "${MARMASM_ARMASM64}") endif() else() enable_language(ASM_MASM) From d33fbcf0cc5af75622d17ac503398cf8a524ae50 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Wed, 15 Jul 2026 10:18:50 -0500 Subject: [PATCH 2/3] ci: Bring Ubuntu versions forward Updates github actions to use Ubuntu 26. --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8b1013ea..2e0593816 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-24.04' }} uses: lukka/get-cmake@latest with: - cmakeVersion: 3.22.1 + cmakeVersion: 3.28.3 - run: sudo apt update - run: sudo apt install --yes --no-install-recommends libwayland-dev libxrandr-dev - name: ccache @@ -89,7 +89,7 @@ jobs: linux-no-asm: needs: codegen - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 30 steps: - uses: actions/checkout@v7 @@ -116,7 +116,7 @@ jobs: linux-32: needs: codegen - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 30 strategy: matrix: @@ -128,7 +128,7 @@ jobs: python-version: '3.11' - uses: lukka/get-cmake@latest with: - cmakeVersion: 3.22.1 + cmakeVersion: 3.28.3 - name: Enable 32 bit run: sudo dpkg --add-architecture i386 - run: sudo apt-get update @@ -161,7 +161,7 @@ jobs: linux-32-no-asm: needs: codegen - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 30 steps: - uses: actions/checkout@v7 @@ -170,7 +170,7 @@ jobs: python-version: '3.11' - uses: lukka/get-cmake@latest with: - cmakeVersion: 3.22.1 + cmakeVersion: 3.28.3 - name: Enable 32 bit run: sudo dpkg --add-architecture i386 - run: sudo apt-get update @@ -202,7 +202,7 @@ jobs: linux-arm: needs: codegen - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-26.04-arm timeout-minutes: 30 steps: - uses: actions/checkout@v7 @@ -212,7 +212,7 @@ jobs: - name: Test CMake min uses: lukka/get-cmake@latest with: - cmakeVersion: 3.22.1 + cmakeVersion: 3.28.3 - run: sudo apt update - run: sudo apt install --yes --no-install-recommends libwayland-dev libxrandr-dev - name: ccache @@ -234,7 +234,7 @@ jobs: linux-threading: needs: codegen - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-26.04-arm timeout-minutes: 30 steps: - uses: actions/checkout@v7 @@ -244,7 +244,7 @@ jobs: - name: Test CMake min uses: lukka/get-cmake@latest with: - cmakeVersion: 3.22.1 + cmakeVersion: 3.28.3 - run: sudo apt update - run: sudo apt install --yes --no-install-recommends libwayland-dev libxrandr-dev - name: ccache From dc9f9ee28111172019b224d757dd34481246703c Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Thu, 6 Aug 2026 15:49:30 -0500 Subject: [PATCH 3/3] Make use of CMAKE_COMPILE_WARNING_AS_ERROR CMake now offers a mechanism to enable compiler warnings as errors with ease. BUILD_WERROR is now implemented in terms of this new mechanism. --- CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ce7a1d26..186de0244 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,21 +173,19 @@ else() string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR) endif() + option(BUILD_WERROR "Enable warnings as errors") +if (BUILD_WERROR) + set(CMAKE_COMPILE_WARNING_AS_ERROR ON) +endif() # Set warnings as errors and the main diagnostic flags # Must be set first so the warning silencing later on works properly # Note that clang-cl.exe should use MSVC flavor flags, not GNU if (CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")) - if (BUILD_WERROR) - target_compile_options(loader_common_options INTERFACE $<$:/WX>) - endif() target_compile_options(loader_common_options INTERFACE $<$:/W4>) elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") # using GCC or Clang with the regular front end - if (BUILD_WERROR) - target_compile_options(loader_common_options INTERFACE $<$:-Werror>) - endif() target_compile_options(loader_common_options INTERFACE $<$:-Wall> $<$:-Wextra>