diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index e844b3d8d..a8aa2dcb3 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -806,15 +806,6 @@ void VulkanHppGenerator::generateCppModuleFile() const module; -// clang-format off -#include -// clang-format on - -#if defined( VULKAN_HPP_STD_MODULE ) -import VULKAN_HPP_STD_MODULE; -import VULKAN_HPP_STD_COMPAT_MODULE; -#endif - #include #include #include diff --git a/snippets/includes.hpp b/snippets/includes.hpp index 34d43ec26..8a66239fa 100644 --- a/snippets/includes.hpp +++ b/snippets/includes.hpp @@ -6,6 +6,9 @@ # include // strnlen # include // std::string # include // std::exchange +#else +import VULKAN_HPP_STD_MODULE; +import VULKAN_HPP_STD_COMPAT_MODULE; #endif #include diff --git a/snippets/macros.hpp b/snippets/macros.hpp index 2c9d4604b..a3cb02cd3 100644 --- a/snippets/macros.hpp +++ b/snippets/macros.hpp @@ -77,7 +77,7 @@ # define VULKAN_HPP_SUPPORT_SPAN #endif -#if !defined( VULKAN_HPP_STD_MODULE ) && ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_modules ) && defined( VULKAN_HPP_ENABLE_STD_MODULE ) +#if ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_modules ) && !defined( VULKAN_HPP_STD_MODULE ) # define VULKAN_HPP_STD_MODULE std # define VULKAN_HPP_STD_COMPAT_MODULE std.compat #endif diff --git a/tests/CppStdModule/CMakeLists.txt b/tests/CppStdModule/CMakeLists.txt index 79e3d8cc4..95b9fb6ab 100644 --- a/tests/CppStdModule/CMakeLists.txt +++ b/tests/CppStdModule/CMakeLists.txt @@ -1,7 +1,5 @@ cmake_minimum_required( VERSION 3.30 ) -set(CMAKE_CXX_MODULE_STD ON) - target_compile_features( VulkanHppModule PUBLIC cxx_std_23 ) target_compile_definitions( VulkanHppModule PUBLIC VULKAN_HPP_ENABLE_STD_MODULE ) diff --git a/vulkan/vulkan.cppm b/vulkan/vulkan.cppm index 1be150785..10e3f1f41 100644 --- a/vulkan/vulkan.cppm +++ b/vulkan/vulkan.cppm @@ -10,15 +10,6 @@ module; -// clang-format off -#include -// clang-format on - -#if defined( VULKAN_HPP_STD_MODULE ) -import VULKAN_HPP_STD_MODULE; -import VULKAN_HPP_STD_COMPAT_MODULE; -#endif - #include #include #include diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 132d3687c..ffc5ab623 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -16,6 +16,9 @@ # include // strnlen # include // std::string # include // std::exchange +#else +import VULKAN_HPP_STD_MODULE; +import VULKAN_HPP_STD_COMPAT_MODULE; #endif #include diff --git a/vulkan/vulkan_hpp_macros.hpp b/vulkan/vulkan_hpp_macros.hpp index ddc70a154..a59bda421 100644 --- a/vulkan/vulkan_hpp_macros.hpp +++ b/vulkan/vulkan_hpp_macros.hpp @@ -87,7 +87,7 @@ # define VULKAN_HPP_SUPPORT_SPAN #endif -#if !defined( VULKAN_HPP_STD_MODULE ) && ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_modules ) && defined( VULKAN_HPP_ENABLE_STD_MODULE ) +#if ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_modules ) && !defined( VULKAN_HPP_STD_MODULE ) # define VULKAN_HPP_STD_MODULE std # define VULKAN_HPP_STD_COMPAT_MODULE std.compat #endif