Skip to content

Commit

Permalink
fix CMake and add support for standard library
Browse files Browse the repository at this point in the history
  • Loading branch information
qbojj committed Jul 10, 2024
1 parent bfb0e4b commit 74e7ca6
Show file tree
Hide file tree
Showing 58 changed files with 5,593 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
33 changes: 33 additions & 0 deletions CppModule/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.28)

find_package(VulkanHeaders REQUIRED)

option(VMA_BUILD_WITH_VULKAN_MODULE OFF)
if (${VMA_BUILD_WITH_VULKAN_MODULE})
add_library(Vulkan-Hpp-Module)
target_sources(Vulkan-Hpp-Module PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS ${Vulkan_INCLUDE_DIR}/vulkan
FILES ${Vulkan_INCLUDE_DIR}/vulkan/vulkan.cppm
)
target_compile_features(Vulkan-Hpp-Module PUBLIC cxx_std_20)
target_link_libraries(Vulkan-Hpp-Module PUBLIC Vulkan::Headers)
else()
add_library(Vulkan-Hpp-Module INTERFACE)
target_compile_features(Vulkan-Hpp-Module INTERFACE cxx_std_20)
target_link_libraries(Vulkan-Hpp-Module INTERFACE Vulkan::Headers)
endif()

add_library(VulkanMemoryAllocator-Hpp-Module)
target_sources(VulkanMemoryAllocator-Hpp-Module PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS ../src
FILES ../src/vk_mem_alloc.cppm
)
target_compile_features(VulkanMemoryAllocator-Hpp-Module PUBLIC cxx_std_20)
target_link_libraries(VulkanMemoryAllocator-Hpp-Module PRIVATE Vulkan-Hpp-Module VulkanMemoryAllocator-Hpp)
target_compile_definitions(VulkanMemoryAllocator-Hpp-Module PRIVATE
VMA_USE_VULKAN_HPP_MODULE=$<BOOL:${VMA_BUILD_WITH_VULKAN_MODULE}>
)

target_compile_options(VulkanMemoryAllocator-Hpp-Module PRIVATE -w)
19 changes: 17 additions & 2 deletions Generate.java
Original file line number Diff line number Diff line change
Expand Up @@ -911,19 +911,34 @@ static void generateModule(List<String> enums, List<String> structs, List<Handle
#define VMA_USE_VULKAN_HPP_MODULE 0
#endif
#ifndef VMA_USE_STD_MODULE
#define VMA_USE_STD_MODULE 0
#endif
#define VMA_IMPLEMENTATION
#include <vk_mem_alloc.h>
#if !VMA_USE_VULKAN_HPP_MODULE
#if VMA_USE_VULKAN_HPP_MODULE
#include <vulkan/vulkan_hpp_macros.hpp>
#else
#include <vulkan/vulkan.hpp>
#endif // !VMA_USE_VULKAN_HPP_MODULE
#endif
#if !VMA_USE_STD_MODULE
#include <string>
#include <vector>
#endif
export module vk_mem_alloc_hpp;
#if VMA_USE_VULKAN_HPP_MODULE
import vulkan_hpp;
#endif
#if VMA_USE_STD_MODULE
import std.compat;
#endif
#include "vk_mem_alloc.hpp"
""" +
Expand Down
Binary file added build/.ninja_deps
Binary file not shown.
38 changes: 38 additions & 0 deletions build/.ninja_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ninja log v6
2 11 1720624312194053750 CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/CXX.dd fbbb63f29657d6d3
114 5175 1720623597026616918 CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/vulkan_hpp.pcm dbf3ac0f7c9c86d0
5175 5202 1720623597033620428 CppModule/Debug/libVulkan-Hpp-Module.a da80c211655e068f
4141 4170 1720624325755183705 CppModule/Debug/libVulkanMemoryAllocator-Hpp-Module.a bcec6d1bb9a1cb67
81 4141 1720624325736173806 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/vk_mem_alloc_hpp.pcm 9954806cdf7aabb6
81 4141 1720624325736173806 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o 9954806cdf7aabb6
72 81 1720624321694063945 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.modmap 8d9fd3799afa9d37
72 81 1720624321694063945 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXX.dd 8d9fd3799afa9d37
2 72 1720624321616023085 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.ddi 104fdb51bd5e36a
2 11 1720624312194053750 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/CXXModules.json fbbb63f29657d6d3
2 11 1720624312194053750 CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/usr/include/vulkan/vulkan.cppm.o.modmap fbbb63f29657d6d3
114 5175 1720623597026616918 CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/usr/include/vulkan/vulkan.cppm.o dbf3ac0f7c9c86d0
72 81 1720624321694063945 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXXModules.json 8d9fd3799afa9d37
1 105 1720623591859025442 CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/usr/include/vulkan/vulkan.cppm.o.ddi e037b735d12d4ea6
1 11 1720625000946859469 CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/CXX.dd fbbb63f29657d6d3
1 11 1720625000946859469 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/CXXModules.json fbbb63f29657d6d3
1 11 1720625000946859469 CppModule/CMakeFiles/Vulkan-Hpp-Module.dir/Debug/usr/include/vulkan/vulkan.cppm.o.modmap fbbb63f29657d6d3
2 55 1720625000947857404 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.ddi c4d8d43ec879bddf
55 64 1720625001008732225 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXX.dd 8d9fd3799afa9d37
55 64 1720625001008732225 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXXModules.json 8d9fd3799afa9d37
55 64 1720625001008732225 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.modmap 8d9fd3799afa9d37
2 53 1720625069283835036 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.ddi c4d8d43ec879bddf
53 62 1720625069334841420 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXX.dd 8d9fd3799afa9d37
53 62 1720625069334841420 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXXModules.json 8d9fd3799afa9d37
53 62 1720625069334841420 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.modmap 8d9fd3799afa9d37
2 56 1720625206187610594 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.ddi c4d8d43ec879bddf
56 64 1720625206241588406 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXX.dd 8d9fd3799afa9d37
56 64 1720625206241588406 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXXModules.json 8d9fd3799afa9d37
56 64 1720625206241588406 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.modmap 8d9fd3799afa9d37
2 57 1720625240179546689 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.ddi c4d8d43ec879bddf
57 66 1720625240234523835 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXX.dd 8d9fd3799afa9d37
57 66 1720625240234523835 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXXModules.json 8d9fd3799afa9d37
57 66 1720625240234523835 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.modmap 8d9fd3799afa9d37
2 54 1720625395054930165 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.ddi c4d8d43ec879bddf
54 62 1720625395107916450 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXX.dd 8d9fd3799afa9d37
54 62 1720625395107916450 /home/kuba/Desktop/gitproj/VulkanMemoryAllocator-Hpp/build/CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/CXXModules.json 8d9fd3799afa9d37
54 62 1720625395107916450 CppModule/CMakeFiles/VulkanMemoryAllocator-Hpp-Module.dir/Debug/__/src/vk_mem_alloc.cppm.o.modmap 8d9fd3799afa9d37
Loading

0 comments on commit 74e7ca6

Please sign in to comment.