blob: e8e4d785aae7cf5df66809fb50a0514446dc4fc6 [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") {
Peter Kastingf67d7fa2021-06-10 08:52:53 -070012 include_dirs = [ "include" ]
Jamie Madilldac952e2020-05-05 12:17:44 -040013 if (is_clang) {
14 cflags_cc = [
Geoff Lange0216a52021-08-30 11:58:07 -040015 "-Wno-deprecated-copy",
Jamie Madilldac952e2020-05-05 12:17:44 -040016 "-Wno-implicit-fallthrough",
17 "-Wno-nullability-completeness",
Jamie Madill67dd6ca2020-08-26 00:58:13 -040018 "-Wno-suggest-destructor-override",
19 "-Wno-suggest-override",
Jamie Madilldac952e2020-05-05 12:17:44 -040020 "-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 Huangc039c222021-01-27 15:23:45 -050029 defines = [
30 "VMA_DYNAMIC_VULKAN_FUNCTIONS=0",
31 "VMA_STATIC_VULKAN_FUNCTIONS=0",
32 ]
Jamie Madilldac952e2020-05-05 12:17:44 -040033}
34
35source_set("vulkan_memory_allocator") {
Peng Huangc039c222021-01-27 15:23:45 -050036 sources = [
Peter Kastingf67d7fa2021-06-10 08:52:53 -070037 "include/vk_mem_alloc.h",
Peng Huangb1d65a22021-01-27 20:00:45 -050038 "vma.cpp",
Peng Huangc039c222021-01-27 15:23:45 -050039 ]
Corentin Wallez1ecb35c2021-04-06 12:01:01 +020040 deps = [ "${vma_vulkan_headers_dir}:vulkan_headers" ]
Peng Huangc039c222021-01-27 15:23:45 -050041 public_configs = [ ":vulkan_memory_allocator_config" ]
42}