Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -116,7 +116,7 @@ jobs:

linux-32:
needs: codegen
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 30
strategy:
matrix:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
16 changes: 6 additions & 10 deletions CMakeLists.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highly recommend adding this as the standard way for package managers to disable warnings as errors while keeping life simple for devs

# https://cmake.org/cmake/help/latest/variable/CMAKE_COMPILE_WARNING_AS_ERROR.html
# Override at the command line with --compile-no-warning-as-error
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)

Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -175,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 $<$<COMPILE_LANGUAGE::CXX,C>:/WX>)
endif()
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:/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 $<$<COMPILE_LANGUAGE::CXX,C>:-Werror>)
endif()
target_compile_options(loader_common_options INTERFACE
$<$<COMPILE_LANGUAGE::CXX,C>:-Wall>
$<$<COMPILE_LANGUAGE::CXX,C>:-Wextra>
Expand Down
40 changes: 17 additions & 23 deletions loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down