From 25f972574832ef05b966f542e79ecffb20a67f4a Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Fri, 9 Jul 2021 21:24:22 +0200
Subject: [PATCH] [#59] Second try to fix MSVC magic

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 config/lib/VulkanMemoryAllocator.cmake | 1 -
 vma/CMakeLists.txt                     | 5 +----
 vma/vma.cpp                            | 3 +++
 3 files changed, 4 insertions(+), 5 deletions(-)
 create mode 100644 vma/vma.cpp

diff --git a/config/lib/VulkanMemoryAllocator.cmake b/config/lib/VulkanMemoryAllocator.cmake
index cb9e598b..c918bd29 100644
--- a/config/lib/VulkanMemoryAllocator.cmake
+++ b/config/lib/VulkanMemoryAllocator.cmake
@@ -1,7 +1,6 @@
 
 if ((EXISTS "${vkcv_lib_path}/VulkanMemoryAllocator") AND
 	(EXISTS "${vkcv_lib_path}/VulkanMemoryAllocator-Hpp"))
-	set(VMA_PATH "${vkcv_lib_path}/VulkanMemoryAllocator" CACHE INTERNAL "")
 	set(VMA_HPP_PATH "${vkcv_lib_path}/VulkanMemoryAllocator-Hpp" CACHE INTERNAL "")
 	
 	set(VMA_RECORDING_ENABLED OFF CACHE INTERNAL "")
diff --git a/vma/CMakeLists.txt b/vma/CMakeLists.txt
index 75089d64..a2c018f2 100644
--- a/vma/CMakeLists.txt
+++ b/vma/CMakeLists.txt
@@ -4,7 +4,6 @@ project(VulkanMemoryAllocator)
 
 find_package(Vulkan REQUIRED)
 
-option(VMA_PATH "Location of official API and headers" "")
 option(VMA_HPP_PATH "Location of C++ headers" "")
 
 message(STATUS "VMA_BUILD_SAMPLE = ${VMA_BUILD_SAMPLE}")
@@ -28,9 +27,7 @@ message(STATUS "VMA_DEBUG_INITIALIZE_ALLOCATIONS = ${VMA_DEBUG_INITIALIZE_ALLOCA
 message(STATUS "VMA_DEBUG_GLOBAL_MUTEX = ${VMA_DEBUG_GLOBAL_MUTEX}")
 message(STATUS "VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT = ${VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT}")
 
-set(VMA_LIBRARY_SOURCE_FILES ${VMA_PATH}/src/VmaUsage.cpp)
-
-add_library(VulkanMemoryAllocator ${VMA_LIBRARY_SOURCE_FILES})
+add_library(VulkanMemoryAllocator vma.cpp)
 
 set_target_properties(
 		VulkanMemoryAllocator PROPERTIES
diff --git a/vma/vma.cpp b/vma/vma.cpp
new file mode 100644
index 00000000..0b92d5b6
--- /dev/null
+++ b/vma/vma.cpp
@@ -0,0 +1,3 @@
+
+#define VMA_IMPLEMENTATION
+#include "vk_mem_alloc.hpp"
-- 
GitLab