未验证 提交 473f5594 编写于 作者: S stuartmorgan 提交者: GitHub

Suppress some deprecation warnings on Windows (#16416)

Targeted suppression of some deprecation warnings that are build errors under
clang:
- Ignore the deprecation of codecvt's unicode conversion until we decide on
  a replacement strategy.
- Allow the deprecated posix names of functions in third_party/txt.

Part of https://github.com/flutter/flutter/issues/16256
上级 f25d325b
......@@ -202,6 +202,11 @@ source_set("fml") {
"platform/win/paths_win.cc",
"platform/win/wstring_conversion.h",
]
if (is_win) {
# For wstring_conversion. See issue #50053.
defines = [ "_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING" ]
}
} else {
sources += [
"platform/posix/file_posix.cc",
......
......@@ -53,6 +53,11 @@ source_set("common_cpp") {
# won't have a JSON dependency.
defines = [ "USE_RAPID_JSON" ]
deps += [ "//third_party/rapidjson" ]
if (is_win) {
# For wstring_conversion. See issue #50053.
defines += [ "_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING" ]
}
}
copy("publish_headers") {
......
......@@ -28,6 +28,14 @@ config("txt_config") {
include_dirs = [ "src" ]
}
config("allow_posix_names") {
if (is_win && is_clang) {
# POSIX names of many functions are marked deprecated by default;
# disable that since they are used for cross-platform compatibility.
defines = [ "_CRT_NONSTDC_NO_DEPRECATE" ]
}
}
source_set("txt") {
defines = []
if (flutter_use_fontconfig) {
......@@ -296,6 +304,8 @@ executable("txt_unittests") {
]
}
configs += [ ":allow_posix_names" ]
deps = [
":txt",
":txt_test_utils",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册