skia2/third_party/vulkanmemoryallocator/BUILD.gn
Brandon DeRosier c0ff5a8560 Add flag that can be used to disable std::shared_mutex use in VMA.
This is needed for enabling Skia's Vulkan backend for Flutter on Windows and iOS 9, as the standard libraries in both of these contexts don't have `std::shared_mutex`.

When disabled on Windows, VMA falls back to using Win32 SRWLock.
The `vulkan.h` import in `vk_mem_alloc.h` which would normally import `windows.h` is commented out for Skia, and so the relevant symbols need to be declared before importing `vk_mem_alloc.h`.

Relevant Flutter Engine PR: https://github.com/flutter/engine/pull/29520

Change-Id: I2b1a621417155071b21e5c6d3b5ccc375c92a622
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469207
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brandon DeRosier <bdero@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-11-12 01:35:08 +00:00

36 lines
725 B
Plaintext

# Copyright 2018 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../gn/skia.gni")
config("vulkanmemoryallocator_public") {
include_dirs = [ "." ]
}
source_set("vulkanmemoryallocator") {
public_configs = [ ":vulkanmemoryallocator_public" ]
include_dirs = [
"../..",
"../../include/third_party/vulkan",
]
if (skia_disable_vma_stl_shared_mutex) {
defines = [ "VMA_USE_STL_SHARED_MUTEX=0" ]
}
sources = [
"GrVulkanMemoryAllocator.cpp",
"GrVulkanMemoryAllocator.h",
]
# Warnings are just noise if we're not maintaining the code.
if (is_win) {
cflags = [ "/w" ]
} else {
cflags = [ "-w" ]
}
}