blob: fb1a120a5da818374dd37b7604a3f61dbdb13988 [file] [log] [blame]
Jamie Madilldac952e2020-05-05 12:17:44 -04001# 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 Wallez1ecb35c2021-04-06 12:01:01 +02007declare_args() {
8 vma_vulkan_headers_dir = "//third_party/vulkan-deps/vulkan-headers/src"
9}
10
Jamie Madilldac952e2020-05-05 12:17:44 -040011config("vulkan_memory_allocator_config") {
12 include_dirs = [ "src" ]
13 if (is_clang) {
14 cflags_cc = [
15 "-Wno-implicit-fallthrough",
16 "-Wno-nullability-completeness",
Jamie Madill67dd6ca2020-08-26 00:58:13 -040017 "-Wno-suggest-destructor-override",
18 "-Wno-suggest-override",
Jamie Madilldac952e2020-05-05 12:17:44 -040019 "-Wno-unused-private-field",
20 "-Wno-unused-variable",
21 ]
22 }
23 if (is_win && !is_clang) {
24 cflags_cc = [
25 "/wd4189", # local variable is initialized but not referenced
26 ]
27 }
Peng Huangc039c222021-01-27 15:23:45 -050028 defines = [
29 "VMA_DYNAMIC_VULKAN_FUNCTIONS=0",
30 "VMA_STATIC_VULKAN_FUNCTIONS=0",
31 ]
Jamie Madilldac952e2020-05-05 12:17:44 -040032}
33
34source_set("vulkan_memory_allocator") {
Peng Huangc039c222021-01-27 15:23:45 -050035 sources = [
Peng Huangc039c222021-01-27 15:23:45 -050036 "src/vk_mem_alloc.h",
Peng Huangb1d65a22021-01-27 20:00:45 -050037 "vma.cpp",
Peng Huangc039c222021-01-27 15:23:45 -050038 ]
Corentin Wallez1ecb35c2021-04-06 12:01:01 +020039 deps = [ "${vma_vulkan_headers_dir}:vulkan_headers" ]
Peng Huangc039c222021-01-27 15:23:45 -050040 public_configs = [ ":vulkan_memory_allocator_config" ]
41}