Skip to content

Version check in build assumes a fully built and installed copy of Vulkan-headers #1983

Description

@zoddicus

In the build rules, there is a version check here that assumes a fully built and installed copy of Vulkan-Headers. Specifically it uses find_package to get the version and if the Header isn't installed the value for VulkanHeaders_VERSION will be undefined, which leads to a syntax error. This creates a hard workflow dependency where it is expected that Vulkan-headers is configured, built and installed before configuring Vulkan-Loader.

This becomes an issue for Dawn, since our CMake rules use add_subdirectory on the various dependencies to configure all of the dependencies and then build all of the dependencies as part of the build instead of having them individually built/installed beforehand.

Since the VulkanHeaders haven't been built and installed at configure time, this causes the above mentioned syntax error. This can be worked around, patch, by just defining a faux value for the version.

I think the Vulkan-Loader build rules could be adjusted to support our build flow without causing breaking changes to existing users. Specifically by either adding a guard to the check to ensure that VulkanHeaders_VERSION is defined in the conditional, or by skipping the entire check if Vulkan::Headers is already present, i.e. if someone is building using add_subdirectory they are responsible for ensuring the version is good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions