mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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
This commit is contained in:
parent
f25d325b1e
commit
473f55940f
@ -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") {
|
||||
|
||||
10
third_party/txt/BUILD.gn
vendored
10
third_party/txt/BUILD.gn
vendored
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user