Skip to content

Custom Vulkan::cppm CMake target code doesn't work with tutorial C++ code #87

@katas94

Description

@katas94

In the Developer environment chapter, within the Common considerations > CMake section, there is some code that declares a custom Vulkan::cppm target to use with your CMake project. While trying to setup my CMake project I was not being able to compile C++ code that I got from the tutorial. The issue was that VULKAN_HPP_NO_STRUCT_CONSTRUCTORS was undefined, contrary to how Vulkan::cppm is initialized in the actual CMakeLists.txt from the tutorial repo, where the define is set. Adding the define like this fixed the issue:

target_compile_definitions(VulkanCppModule PUBLIC
        VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1
        VULKAN_HPP_NO_STRUCT_CONSTRUCTORS=1
)

It is probably worth to mention this, or add the define in the example CMake code just as it is defined in the tutorial code.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions