diff --git a/fml/BUILD.gn b/fml/BUILD.gn index ef0e996daea6d..04ce5527fef7d 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -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", diff --git a/shell/platform/common/cpp/BUILD.gn b/shell/platform/common/cpp/BUILD.gn index 4646e5c68c9ca..b4d5b0a5bf88b 100644 --- a/shell/platform/common/cpp/BUILD.gn +++ b/shell/platform/common/cpp/BUILD.gn @@ -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") { diff --git a/third_party/txt/BUILD.gn b/third_party/txt/BUILD.gn index 63bf09e444457..e3f07f558736e 100644 --- a/third_party/txt/BUILD.gn +++ b/third_party/txt/BUILD.gn @@ -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",