Jamie Madill | dac952e | 2020-05-05 12:17:44 -0400 | [diff] [blame] | 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 | |
Corentin Wallez | 1ecb35c | 2021-04-06 12:01:01 +0200 | [diff] [blame] | 7 | declare_args() { |
| 8 | vma_vulkan_headers_dir = "//third_party/vulkan-deps/vulkan-headers/src" |
| 9 | } |
| 10 | |
Jamie Madill | dac952e | 2020-05-05 12:17:44 -0400 | [diff] [blame] | 11 | config("vulkan_memory_allocator_config") { |
Peter Kasting | f67d7fa | 2021-06-10 08:52:53 -0700 | [diff] [blame] | 12 | include_dirs = [ "include" ] |
Jamie Madill | dac952e | 2020-05-05 12:17:44 -0400 | [diff] [blame] | 13 | if (is_clang) { |
| 14 | cflags_cc = [ |
Geoff Lang | e0216a5 | 2021-08-30 11:58:07 -0400 | [diff] [blame^] | 15 | "-Wno-deprecated-copy", |
Jamie Madill | dac952e | 2020-05-05 12:17:44 -0400 | [diff] [blame] | 16 | "-Wno-implicit-fallthrough", |
| 17 | "-Wno-nullability-completeness", |
Jamie Madill | 67dd6ca | 2020-08-26 00:58:13 -0400 | [diff] [blame] | 18 | "-Wno-suggest-destructor-override", |
| 19 | "-Wno-suggest-override", |
Jamie Madill | dac952e | 2020-05-05 12:17:44 -0400 | [diff] [blame] | 20 | "-Wno-unused-private-field", |
| 21 | "-Wno-unused-variable", |
| 22 | ] |
| 23 | } |
| 24 | if (is_win && !is_clang) { |
| 25 | cflags_cc = [ |
| 26 | "/wd4189", # local variable is initialized but not referenced |
| 27 | ] |
| 28 | } |
Peng Huang | c039c22 | 2021-01-27 15:23:45 -0500 | [diff] [blame] | 29 | defines = [ |
| 30 | "VMA_DYNAMIC_VULKAN_FUNCTIONS=0", |
| 31 | "VMA_STATIC_VULKAN_FUNCTIONS=0", |
| 32 | ] |
Jamie Madill | dac952e | 2020-05-05 12:17:44 -0400 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | source_set("vulkan_memory_allocator") { |
Peng Huang | c039c22 | 2021-01-27 15:23:45 -0500 | [diff] [blame] | 36 | sources = [ |
Peter Kasting | f67d7fa | 2021-06-10 08:52:53 -0700 | [diff] [blame] | 37 | "include/vk_mem_alloc.h", |
Peng Huang | b1d65a2 | 2021-01-27 20:00:45 -0500 | [diff] [blame] | 38 | "vma.cpp", |
Peng Huang | c039c22 | 2021-01-27 15:23:45 -0500 | [diff] [blame] | 39 | ] |
Corentin Wallez | 1ecb35c | 2021-04-06 12:01:01 +0200 | [diff] [blame] | 40 | deps = [ "${vma_vulkan_headers_dir}:vulkan_headers" ] |
Peng Huang | c039c22 | 2021-01-27 15:23:45 -0500 | [diff] [blame] | 41 | public_configs = [ ":vulkan_memory_allocator_config" ] |
| 42 | } |