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

Isolating generator targets and creating header-only interface target #2042

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

M2-TE
Copy link

@M2-TE M2-TE commented Jan 9, 2025

Resolves #2037

New CMake option VULKAN_HPP_GENERATOR_BUILD to control the creation of both VulkanHppGenerator and VideoHppGenerator targets, defaulting to ON as to not break anything.
Naming was based on VULKAN_HPP_SAMPLES_BUILD and VULKAN_HPP_TESTS_BUILD, could otherwise rename to VULKAN_HPP_BUILD_GENERATOR to fit VULKAN_HPP_RUN_GENERATOR naming scheme.

Also created the Vulkan-Hpp interface target, aliased as Vulkan::Hpp for those just looking to get the include directory. Naming is akin to the Vulkan-Headers with their Vulkan-Headers interface target, aliased as Vulkan::Headers.
The target is always created and it might make sense to use it in the other build targets as a unified way to include the generated headers? Otherwise it can be hidden behind a CMake option or function if necessary.

This PR would allow fetching a specific version of Vulkan headers using the following CMake syntax:

include(FetchContent)
FetchContent_Declare(vulkan-headers
    GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Headers.git"
    GIT_TAG "v1.4.303"
    GIT_SHALLOW ON
    OVERRIDE_FIND_PACKAGE
    EXCLUDE_FROM_ALL
    SYSTEM)
FetchContent_Declare(vulkan-hpp
    GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Hpp.git"
    GIT_TAG "v1.4.303"
    GIT_SHALLOW ON
    GIT_SUBMODULES ""
    OVERRIDE_FIND_PACKAGE
    EXCLUDE_FROM_ALL
    SYSTEM)
FetchContent_MakeAvailable(vulkan-headers vulkan-hpp)
target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::Headers Vulkan::Hpp)

@CLAassistant
Copy link

CLAassistant commented Jan 9, 2025

CLA assistant check
All committers have signed the CLA.

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.

Isolate VulkanHppGenerator and VideoHppGenerator in CMakeLists.txt
2 participants