Skip to content

Commit dff332f

Browse files
committed
Adjust CMake configuration for VulkanCppModule
- Change `target_include_directories` from `PRIVATE` to `PUBLIC` for broader access. - Add MSVC-specific compiler options to support proper C++20 module compatibility.
1 parent d7aaf9b commit dff332f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

attachments/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if(ENABLE_CPP20_MODULE)
2828
PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_NO_STRUCT_CONSTRUCTORS=1
2929
)
3030
target_include_directories(VulkanCppModule
31-
PRIVATE
31+
PUBLIC
3232
"${Vulkan_INCLUDE_DIR}"
3333
)
3434
target_link_libraries(VulkanCppModule
@@ -38,6 +38,18 @@ if(ENABLE_CPP20_MODULE)
3838

3939
set_target_properties(VulkanCppModule PROPERTIES CXX_STANDARD 20)
4040

41+
# Add MSVC-specific compiler options for proper C++ module support
42+
if(MSVC)
43+
target_compile_options(VulkanCppModule PRIVATE
44+
/std:c++latest # Use latest C++ standard for better module support
45+
/permissive- # Standards conformance mode
46+
/Zc:__cplusplus # Enable correct __cplusplus macro
47+
/EHsc # Enable C++ exception handling
48+
/Zc:preprocessor # Use conforming preprocessor
49+
/translateInclude # Automatically translate #include to import for standard library
50+
)
51+
endif()
52+
4153
target_sources(VulkanCppModule
4254
PUBLIC
4355
FILE_SET cxx_modules TYPE CXX_MODULES

0 commit comments

Comments
 (0)