Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 6abf1dd

Browse files
committed
disable shared mutex on some platforms
1 parent 5e96895 commit 6abf1dd

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

flutter_vma/BUILD.gn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5+
import("//flutter/flutter_vma/config.gni")
6+
57
source_set("flutter_vma") {
68
sources = [
79
"flutter_vma.cc",
810
"flutter_vma.h",
911
]
1012

13+
if (disable_vma_stl_shared_mutex) {
14+
defines = [ "VMA_USE_STL_SHARED_MUTEX=0" ]
15+
}
16+
1117
deps = [
1218
"//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers",
1319
"//third_party/vulkan_memory_allocator",

flutter_vma/config.gni

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2013 The Flutter 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+
declare_args() {
6+
disable_vma_stl_shared_mutex = false
7+
}

tools/gn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,10 @@ def to_gn_args(args):
438438
gn_args['skia_use_vulkan'] = True
439439
gn_args['skia_use_vma'] = False
440440
gn_args['shell_enable_vulkan'] = True
441+
# Disable VMA's use of std::shared_mutex in environments where the
442+
# standard library doesn't support it.
443+
if args.target_os == 'ios' or sys.platform.startswith(('cygwin', 'win')):
444+
gn_args['disable_vma_stl_shared_mutex'] = True
441445

442446
# We should not need a special case for x86, but this seems to introduce text relocations
443447
# even with -fPIC everywhere.

0 commit comments

Comments
 (0)