Skip to content

Commit 60d942d

Browse files
authored
[win32] Suppress win32 swiftshader warnings (#562)
Suppresses several Windows-specific warnings emitted during swiftshader builds: * On swiftshader builds against Win32 C++ headers, warnings are emitted about subclassing std::iterator, which was deprecated in C++17. This affects a header file in swiftshader's third-party directory: third_party/swiftshader/third_party/llvm-subzero/include/llvm/ADT/iterator.h * Three functions in libVulkan.cpp are re-declared with a difference in dllexport attribute only. * Silence implicit string conversion warnings in two places in swiftshader where asserts of the form assert(!"Error msg") are used. Issue: #59199
1 parent 83a4451 commit 60d942d

File tree

1 file changed

+16
-0
lines changed
  • build/secondary/third_party/swiftshader_flutter

1 file changed

+16
-0
lines changed

build/secondary/third_party/swiftshader_flutter/BUILD.gn

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ config("internal_config") {
2727
]
2828

2929
if (is_win) {
30+
cflags += [
31+
# Silence warnings about redeclaration of vk_icdGetInstanceProcAddr,
32+
# vk_icdNegotiateLoaderICDInterfaceVersion, vkGetInstanceProcAddr in
33+
# //third_party/swiftshader/src/Vulkan/libVulkan.cpp.
34+
"-Wno-dll-attribute-on-redeclaration",
35+
# Silence warnings about strings (ab)used in assertions in
36+
# FrameBufferDD.cpp. e.g. assert(!"Failed to initialize graphics:...")
37+
"-Wno-string-conversion",
38+
]
39+
40+
defines += [
41+
# std::iterator is deprecated as a base class, but used in
42+
# third_party/swiftshader/third_party/llvm-subzero/include/llvm/ADT/iterator.h
43+
"_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING",
44+
]
45+
3046
libs = [
3147
"user32.lib",
3248
"gdi32.lib",

0 commit comments

Comments
 (0)