Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Offer multiple choices for Vulkan C headers #2075

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

M2-TE
Copy link
Contributor

@M2-TE M2-TE commented Feb 17, 2025

Using following priority to determine where to get the C headers:

  1. Vulkan-Headers subdirectory, if submodule is pulled
  2. Vulkan::Headers target, if present (e.g. via FindVulkan or add_subdirectory)
  3. Vulkan::Headers target, requiring FindVulkan

@asuessenbach asuessenbach merged commit 74a2ce1 into KhronosGroup:main Feb 18, 2025
58 checks passed
@M2-TE M2-TE deleted the cmake-finding-vulkan branch February 18, 2025 08:47
asuessenbach added a commit to asuessenbach/Vulkan-Hpp that referenced this pull request Feb 18, 2025
@asuessenbach asuessenbach mentioned this pull request Feb 18, 2025
asuessenbach added a commit that referenced this pull request Feb 18, 2025
@asuessenbach
Copy link
Contributor

@M2-TE Your change generated build failures on gitlab.khronos.org/vulkan:

CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) (found
  version "")
Call Stack (most recent call first):
  /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.25/Modules/FindVulkan.cmake:597 (find_package_handle_standard_args)
  CMakeLists.txt:224 (find_package)
-- Configuring incomplete, errors occurred!

Any idea how to resolve that?
For now, I just reverted this by #2080.

@M2-TE
Copy link
Contributor Author

M2-TE commented Feb 18, 2025

@asuessenbach Would this not indicate that the Vulkan-Headers submodule has not been pulled? If both this and FindVulkan are missing, how were the Vulkan C headers acquired before?

I sadly do not think I have access to gitlab.khronos.org/vulkan, is it a mirror of Vulkan-Hpp?

@asuessenbach
Copy link
Contributor

is it a mirror of Vulkan-Hpp?

@M2-TE No, it's the Vulkan-Headers build. That is: that directory doesn't exist, yet, at that point in time.
And, after all, the VulkanHppGenerator doesn't really need that include directory. It's just the samples and tests, that need it.

Would you like to change your PR accordingly?

@M2-TE
Copy link
Contributor Author

M2-TE commented Feb 19, 2025

the VulkanHppGenerator doesn't really need that include directory

@asuessenbach That is my bad, makes sense in retrospect.

Would you like to change your PR accordingly?

Yea, I'll simply have CMake emit a warning if the include directory appears be missing.

asuessenbach pushed a commit that referenced this pull request Feb 24, 2025
* reintroduced vulkan C header includes

* include Vulkan C headers in sample/test func
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants