Skip to content

Commit

Permalink
Moved import std macro guard to .cppm file itself
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadhr committed Aug 14, 2024
1 parent 77325c8 commit 925f6ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions VulkanHppGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,11 @@ void VulkanHppGenerator::generateCppModuleFile() const

module;

#include <vulkan/${api}_hpp_macros.hpp>
#if defined( VULKAN_HPP_STD_MODULE )
import VULKAN_HPP_STD_MODULE;
import VULKAN_HPP_STD_COMPAT_MODULE;
#endif
#include <vulkan/${api}.hpp>
#include <vulkan/${api}_extension_inspection.hpp>
#include <vulkan/${api}_format_traits.hpp>
Expand Down
6 changes: 1 addition & 5 deletions snippets/includes.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
#include <vulkan/vulkan_hpp_macros.hpp>

#if !defined( VULKAN_HPP_STD_MODULE )
# include <algorithm>
# include <array> // ArrayWrapperND
# include <string.h> // strnlen
# include <string> // std::string
# include <utility> // std::exchange
#else
import VULKAN_HPP_STD_MODULE;
import VULKAN_HPP_STD_COMPAT_MODULE;
#endif
#include <vulkan/${vulkan_h}>
#include <vulkan/vulkan_hpp_macros.hpp>

#if 17 <= VULKAN_HPP_CPP_VERSION && !defined( VULKAN_HPP_STD_MODULE )
# include <string_view>
Expand Down
5 changes: 5 additions & 0 deletions vulkan/vulkan.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

module;

#include <vulkan/vulkan_hpp_macros.hpp>
#if defined( VULKAN_HPP_STD_MODULE )
import VULKAN_HPP_STD_MODULE;
import VULKAN_HPP_STD_COMPAT_MODULE;
#endif
#include <vulkan/vulkan.hpp>
#include <vulkan/vulkan_extension_inspection.hpp>
#include <vulkan/vulkan_format_traits.hpp>
Expand Down
6 changes: 1 addition & 5 deletions vulkan/vulkan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@
#ifndef VULKAN_HPP
#define VULKAN_HPP

#include <vulkan/vulkan_hpp_macros.hpp>

#if !defined( VULKAN_HPP_STD_MODULE )
# include <algorithm>
# include <array> // ArrayWrapperND
# include <string.h> // strnlen
# include <string> // std::string
# include <utility> // std::exchange
#else
import VULKAN_HPP_STD_MODULE;
import VULKAN_HPP_STD_COMPAT_MODULE;
#endif
#include <vulkan/vulkan.h>
#include <vulkan/vulkan_hpp_macros.hpp>

#if 17 <= VULKAN_HPP_CPP_VERSION && !defined( VULKAN_HPP_STD_MODULE )
# include <string_view>
Expand Down

0 comments on commit 925f6ed

Please sign in to comment.