Skip to content

Commit e229649

Browse files
authored
Extract Windows string_conversion target (flutter#26029)
String conversion between UTF-8 and UTF-16 encodings is useful even in the absence of other common Windows functionality. This is pre-factoring for uwptool, which adds an adb-like helper tool for install, uninstall, and launch of UWP applications for Windows platforms. See: flutter#81756
1 parent 73aaeea commit e229649

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

shell/platform/windows/BUILD.gn

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ source_set("flutter_windows_source") {
7474
"keyboard_key_handler.h",
7575
"platform_handler.cc",
7676
"platform_handler.h",
77-
"string_conversion.cc",
78-
"string_conversion.h",
7977
"system_utils.h",
8078
"task_runner.h",
8179
"text_input_plugin.cc",
@@ -152,6 +150,8 @@ source_set("flutter_windows_source") {
152150
defines = [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]
153151
}
154152

153+
public_deps = [ ":string_conversion" ]
154+
155155
deps = [
156156
":flutter_windows_headers",
157157
"//flutter/shell/platform/common:common_cpp",
@@ -171,6 +171,19 @@ source_set("flutter_windows_source") {
171171
]
172172
}
173173

174+
# String encoding conversion utilities.
175+
source_set("string_conversion") {
176+
sources = [
177+
"string_conversion.cc",
178+
"string_conversion.h",
179+
]
180+
181+
if (target_os == "winuwp") {
182+
configs += [ ":cppwinrt_defs" ]
183+
cflags = [ "/EHsc" ]
184+
}
185+
}
186+
174187
copy("publish_headers_windows") {
175188
sources = _public_headers
176189
outputs = [ "$root_out_dir/{{source_file_part}}" ]

0 commit comments

Comments
 (0)