forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBUILD.gn
More file actions
260 lines (229 loc) · 8.65 KB
/
BUILD.gn
File metadata and controls
260 lines (229 loc) · 8.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_win)
import("//flutter/shell/platform/glfw/config.gni")
import("//flutter/testing/testing.gni")
_public_headers = [ "public/flutter_windows.h" ]
config("relative_angle_headers") {
include_dirs = [ "//third_party/angle/include" ]
}
# Any files that are built by clients (client_wrapper code, library headers for
# implementations using this shared code, etc.) include the public headers
# assuming they are in the include path. This configuration should be added to
# any such code that is also built by GN to make the includes work.
config("relative_flutter_windows_headers") {
include_dirs = [ "public" ]
}
config("cppwinrt_defs") {
# Use winrt headers generated by the cppwinrt tool rather than those shipped in the installed SDK.
# The Windows metadata used to generate the headers does come from the installed SDK, by generating them rather than using the shipped ones
# the latest cppwinrt compatibility fixes can be derived. For example, clang support is broken in the winrt headers shipped in SDK 10.0.19041.0.
# By generating them in the flutter toolchain using the SDK 10.0.19041.0 metadata and the latest version of the cppwinrt tool, that SDK version can be supported.
#
# Generated with command bin\cppwinrt.exe -in sdk -out generated
# by src\build\win\generate_winrt_headers.py
include_dirs = [ "..\..\..\..\third_party\cppwinrt\generated" ]
}
# The headers are a separate source set since the client wrapper is allowed
# to depend on the public headers, but none of the rest of the code.
source_set("flutter_windows_headers") {
public = _public_headers
public_deps = [ "//flutter/shell/platform/common:common_cpp_library_headers" ]
configs +=
[ "//flutter/shell/platform/common:desktop_library_implementation" ]
public_configs =
[ "//flutter/shell/platform/common:relative_flutter_library_headers" ]
}
source_set("flutter_windows_source") {
# Common Windows sources.
sources = [
"accessibility_bridge_delegate_win32.cc",
"accessibility_bridge_delegate_win32.h",
"angle_surface_manager.cc",
"angle_surface_manager.h",
"cursor_handler.cc",
"cursor_handler.h",
"dpi_utils_win32.cc",
"dpi_utils_win32.h",
"event_watcher_win32.cc",
"event_watcher_win32.h",
"external_texture.h",
"external_texture_d3d.cc",
"external_texture_d3d.h",
"external_texture_pixelbuffer.cc",
"external_texture_pixelbuffer.h",
"flutter_key_map.cc",
"flutter_platform_node_delegate_win32.cc",
"flutter_platform_node_delegate_win32.h",
"flutter_project_bundle.cc",
"flutter_project_bundle.h",
"flutter_window_win32.cc",
"flutter_window_win32.h",
"flutter_windows.cc",
"flutter_windows_engine.cc",
"flutter_windows_engine.h",
"flutter_windows_texture_registrar.cc",
"flutter_windows_texture_registrar.h",
"flutter_windows_view.cc",
"flutter_windows_view.h",
"flutter_windows_win32.cc",
"keyboard_handler_base.h",
"keyboard_key_channel_handler.cc",
"keyboard_key_channel_handler.h",
"keyboard_key_embedder_handler.cc",
"keyboard_key_embedder_handler.h",
"keyboard_key_handler.cc",
"keyboard_key_handler.h",
"keyboard_manager_win32.cc",
"keyboard_manager_win32.h",
"keyboard_win32_common.h",
"platform_handler.cc",
"platform_handler.h",
"platform_handler_win32.cc",
"platform_handler_win32.h",
"sequential_id_generator.cc",
"sequential_id_generator.h",
"settings_plugin.cc",
"settings_plugin.h",
"settings_plugin_win32.cc",
"settings_plugin_win32.h",
"system_utils.h",
"system_utils_win32.cc",
"task_runner.cc",
"task_runner.h",
"task_runner_win32.cc",
"task_runner_win32.h",
"task_runner_win32_window.cc",
"task_runner_win32_window.h",
"text_input_manager_win32.cc",
"text_input_manager_win32.h",
"text_input_plugin.cc",
"text_input_plugin.h",
"window_binding_handler.h",
"window_binding_handler_delegate.h",
"window_proc_delegate_manager_win32.cc",
"window_proc_delegate_manager_win32.h",
"window_state.h",
"window_win32.cc",
"window_win32.h",
]
libs = [
"dwmapi.lib",
"imm32.lib",
]
configs += [
"//flutter/shell/platform/common:desktop_library_implementation",
"//third_party/angle:gl_prototypes",
]
public_configs = [ ":relative_angle_headers" ]
defines = [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]
public_deps = [
"//flutter/fml:string_conversion",
"//flutter/shell/platform/common:common_cpp_accessibility",
]
deps = [
":flutter_windows_headers",
"//flutter/shell/platform/common:common_cpp",
"//flutter/shell/platform/common:common_cpp_input",
"//flutter/shell/platform/common:common_cpp_switches",
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows",
"//third_party/angle:libEGL_static", # the order of libEGL_static and
# libGLESv2_static is important.. if
# reversed, will cause a linker error
# DllMain already defined in
# LIBCMTD.lib
"//third_party/angle:libGLESv2_static",
"//third_party/rapidjson",
]
}
copy("publish_headers_windows") {
sources = _public_headers
outputs = [ "$root_out_dir/{{source_file_part}}" ]
# The Windows header assumes the presence of the common headers.
deps = [ "//flutter/shell/platform/common:publish_headers" ]
}
shared_library("flutter_windows") {
deps = [ ":flutter_windows_source" ]
public_configs = [ "//flutter:config" ]
}
test_fixtures("flutter_windows_fixtures") {
fixtures = []
}
executable("flutter_windows_unittests") {
testonly = true
# Common Windows test sources.
sources = [
# "flutter_project_bundle_unittests.cc", //TODO failing due to switches test failing. Blocked on https://github.com/flutter/flutter/issues/74153
# "flutter_windows_engine_unittests.cc", //TODO failing to send / receive platform message get plugins working first. Blocked on https://github.com/flutter/flutter/issues/74155
"accessibility_bridge_delegate_win32_unittests.cc",
"dpi_utils_win32_unittests.cc",
"flutter_project_bundle_unittests.cc",
"flutter_window_win32_unittests.cc",
"flutter_windows_engine_unittests.cc",
"flutter_windows_texture_registrar_unittests.cc",
"flutter_windows_view_unittests.cc",
"keyboard_key_channel_handler_unittests.cc",
"keyboard_key_embedder_handler_unittests.cc",
"keyboard_key_handler_unittests.cc",
"keyboard_win32_unittests.cc",
"platform_handler_unittests.cc",
"sequential_id_generator_unittests.cc",
"settings_plugin_unittests.cc",
"system_utils_unittests.cc",
"task_runner_unittests.cc",
"testing/engine_modifier.h",
"testing/flutter_window_win32_test.cc",
"testing/flutter_window_win32_test.h",
"testing/mock_gl_functions.h",
"testing/mock_text_input_manager_win32.cc",
"testing/mock_text_input_manager_win32.h",
"testing/mock_window_binding_handler.cc",
"testing/mock_window_binding_handler.h",
"testing/mock_window_win32.cc",
"testing/mock_window_win32.h",
"testing/test_keyboard.cc",
"testing/test_keyboard.h",
"testing/test_keyboard_unittests.cc",
"testing/wm_builders.cc",
"testing/wm_builders.h",
"text_input_plugin_unittest.cc",
"window_proc_delegate_manager_win32_unittests.cc",
"window_win32_unittests.cc",
]
public_configs = [ "//flutter:config" ]
deps = [
":flutter_windows_fixtures",
":flutter_windows_headers",
":flutter_windows_source",
"//flutter/shell/platform/common:common_cpp",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/testing",
"//third_party/rapidjson",
]
}
shared_library("flutter_windows_glfw") {
deps = [ "//flutter/shell/platform/glfw:flutter_glfw" ]
public_configs = [ "//flutter:config" ]
}
group("windows_glfw") {
deps = [
":flutter_windows",
":flutter_windows_glfw",
"//flutter/shell/platform/glfw:publish_headers_glfw",
"//flutter/shell/platform/glfw/client_wrapper:publish_wrapper_glfw",
]
}
group("windows") {
deps = [
":flutter_windows",
":publish_headers_windows",
"//flutter/shell/platform/windows/client_wrapper:publish_wrapper_windows",
]
if (build_glfw_shell) {
deps += [ ":windows_glfw" ]
}
}