Vulkan doesn't have a memory allocator builtin. The application should provide the memory allocator at runtime. Vulkan Memory Allocator is a widely used implementation. Vulkan Memory Allocator is a header only implementation, but the using application should compile a part in a CPP compile unit. The file `vk_mem_alloc_impl.cc` and `extern_vulkan_memory_allocator` library is therefore introduced. Reviewed By: fclem Differential Revision: https://developer.blender.org/D16572
25 lines
478 B
CMake
25 lines
478 B
CMake
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# Copyright 2022 Blender Foundation. All rights reserved.
|
|
|
|
set(INC
|
|
.
|
|
)
|
|
|
|
set(INC_SYS
|
|
${VULKAN_INCLUDE_DIRS}
|
|
)
|
|
|
|
set(SRC
|
|
vk_mem_alloc_impl.cc
|
|
|
|
vk_mem_alloc.h
|
|
)
|
|
|
|
blender_add_lib(extern_vulkan_memory_allocator "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
target_compile_options(extern_vulkan_memory_allocator
|
|
PRIVATE "-Wno-nullability-completeness"
|
|
)
|
|
endif()
|