1# Copyright 2020 The ANGLE Project Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4# 5# Custom GN integration for VulkanMemoryAllocator. 6 7declare_args() { 8 vma_vulkan_headers_dir = "//third_party/vulkan-deps/vulkan-headers/src" 9} 10 11config("vulkan_memory_allocator_config") { 12 include_dirs = [ "include" ] 13 if (is_clang) { 14 cflags_cc = [ 15 "-Wno-c++98-compat-extra-semi", 16 "-Wno-deprecated-copy", 17 "-Wno-implicit-fallthrough", 18 "-Wno-nullability-completeness", 19 "-Wno-suggest-destructor-override", 20 "-Wno-suggest-override", 21 "-Wno-unused-private-field", 22 "-Wno-unused-variable", 23 ] 24 } 25 if (is_win && !is_clang) { 26 cflags_cc = [ 27 "/wd4189", # local variable is initialized but not referenced 28 ] 29 } 30 defines = [ 31 "VMA_DYNAMIC_VULKAN_FUNCTIONS=0", 32 "VMA_STATIC_VULKAN_FUNCTIONS=0", 33 "VMA_USE_STL_CONTAINERS=1", 34 ] 35} 36 37source_set("vulkan_memory_allocator") { 38 sources = [ 39 "include/vk_mem_alloc.h", 40 "vma.cpp", 41 ] 42 deps = [ "${vma_vulkan_headers_dir}:vulkan_headers" ] 43 public_configs = [ ":vulkan_memory_allocator_config" ] 44} 45