KhronosGroup / KhronosGroup/Vulkan-Hpp

Disable `VULKAN_HPP_ASSERT_ON_RESULT` using CMake

Open
#2,532 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
3.8k
Forks
374
Avg merge
23h 4m
Merged PRs (30d)
32

Description

The way to disable `VULKAN_HPP_ASSERT_ON_RESULT` is by defining it before including a Vulkan header.
I would like to disable it using CMake. (This is a cleaner approach, in my opinion.)
However, CMake doesn't support function-style preprocessor definitions, so there would have to be a new boolean definition instead for turning it on/off.

The worst use case comes with modules.
The user can't even define their own `VULKAN_HPP_ASSERT_ON_RESULT`, and is therefore stuck using the default.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how Vulkan-Hpp's CMake configuration exposes preprocessor definitions and where VULKAN_HPP_ASSERT_ON_RESULT is defined before Vulkan headers are included. Check how CMake handles the proposed boolean option, including module consumers, and verify that users can disable the assertion through configuration without defining the function-style macro themselves.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.