Fixed CMakeLists.txt regarding VMA_DYNAMIC_VULKAN_FUNCTIONS, VMA_STATIC_VULKAN_FUNCTIONS

Closes #218
This commit is contained in:
Adam Sawicki 2022-01-05 18:41:51 +01:00
parent 35bc050aa3
commit c61770a162

View File

@ -26,20 +26,8 @@ set_target_properties(
target_include_directories(VulkanMemoryAllocator PUBLIC "${PROJECT_SOURCE_DIR}/include")
if(${VMA_DYNAMIC_VULKAN_FUNCTIONS})
set(VULKAN_USE_DYNAMIC ${VMA_DYNAMIC_VULKAN_FUNCTIONS})
else()
set(VULKAN_USE_DYNAMIC 0)
endif()
if(${VMA_STATIC_VULKAN_FUNCTIONS})
set(VULKAN_USE_STATIC ${VMA_STATIC_VULKAN_FUNCTIONS})
else()
set(VULKAN_USE_STATIC 1)
endif()
# Only link to Vulkan if static linking is used
if(${VULKAN_USE_STATIC})
if(${VMA_STATIC_VULKAN_FUNCTIONS})
target_link_libraries(VulkanMemoryAllocator PUBLIC Vulkan::Vulkan)
endif()
@ -47,8 +35,8 @@ target_compile_definitions(
VulkanMemoryAllocator
PUBLIC
VMA_STATIC_VULKAN_FUNCTIONS=$<BOOL:${VULKAN_USE_STATIC}>
VMA_DYNAMIC_VULKAN_FUNCTIONS=$<BOOL:${VULKAN_USE_DYNAMIC}>
VMA_STATIC_VULKAN_FUNCTIONS=$<BOOL:${VMA_STATIC_VULKAN_FUNCTIONS}>
VMA_DYNAMIC_VULKAN_FUNCTIONS=$<BOOL:${VMA_DYNAMIC_VULKAN_FUNCTIONS}>
VMA_DEBUG_ALWAYS_DEDICATED_MEMORY=$<BOOL:${VMA_DEBUG_ALWAYS_DEDICATED_MEMORY}>
VMA_DEBUG_INITIALIZE_ALLOCATIONS=$<BOOL:${VMA_DEBUG_INITIALIZE_ALLOCATIONS}>
VMA_DEBUG_GLOBAL_MUTEX=$<BOOL:${VMA_DEBUG_GLOBAL_MUTEX}>