From ef7df1629cc65bcbf83cbec93bfb751649c76396 Mon Sep 17 00:00:00 2001 From: Jan Kuhlmann <33833587+M2-TE@users.noreply.github.com> Date: Fri, 26 Sep 2025 00:17:49 +0200 Subject: [PATCH] add option VULKAN_HEADERS_DISABLE_MODULE_STD to avoid automatic use of import std --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bc166a..f8a2318 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,9 @@ project(VULKAN_HEADERS LANGUAGES C CXX VERSION ${VK_VERSION_STRING}) # options for Vulkan-Headers and the Vulkan-Hpp C++20 module option(VULKAN_HEADERS_ENABLE_TESTS "Test Vulkan-Headers" ${PROJECT_IS_TOP_LEVEL}) option(VULKAN_HEADERS_ENABLE_INSTALL "Install Vulkan-Headers" ${PROJECT_IS_TOP_LEVEL}) -option(VULKAN_HEADERS_ENABLE_MODULE "Enables building of the Vulkan C++20 module; requires minimum CMake version 3.28" OFF) +option(VULKAN_HEADERS_ENABLE_MODULE "Enables building of the Vulkan C++20 module; requires minimum CMake version 3.28" ON) option(VULKAN_HEADERS_ENABLE_MODULE_STD "Enables building of the Vulkan C++20 module with import std; requires minimum CMake version 3.30" OFF) +option(VULKAN_HEADERS_DISABLE_MODULE_STD "Disable automatic use of import std; for the Vulkan C++20 module" OFF) # set up Vulkan-Headers add_library(Vulkan-Headers INTERFACE) @@ -82,6 +83,9 @@ if (VULKAN_HEADERS_ENABLE_MODULE) else() target_compile_features(Vulkan-HppModule PUBLIC cxx_std_20) endif() + if (VULKAN_HEADERS_DISABLE_MODULE_STD) + target_compile_definitions(Vulkan-HppModule PUBLIC VULKAN_HPP_NO_STD_MODULE=ON) + endif() target_link_libraries(Vulkan-HppModule PUBLIC Vulkan::Headers) # Clang 16's module support can be broken with extensions enabled