3
3
# found in the LICENSE file.
4
4
5
5
import (" //flutter/shell/platform/common/client_wrapper/publish.gni" )
6
+ import (" //flutter/shell/platform/config.gni" )
6
7
import (" //flutter/shell/platform/tizen/config.gni" )
8
+ import (" //flutter/testing/testing.gni" )
7
9
8
10
# Sets the rpath of dependent targets (shared libs) to $ORIGIN.
9
11
# We assume that the flutter_engine library exists next to the embedder library
@@ -24,6 +26,29 @@ source_set("flutter_engine") {
24
26
deps = [ " //flutter/shell/platform/embedder:flutter_engine" ]
25
27
}
26
28
29
+ _flutter_tizen_source = [
30
+ " channels/key_event_channel.cc" ,
31
+ " channels/lifecycle_channel.cc" ,
32
+ " channels/navigation_channel.cc" ,
33
+ " channels/platform_view_channel.cc" ,
34
+ " channels/text_input_channel.cc" ,
35
+ " flutter_tizen.cc" ,
36
+ " flutter_tizen_engine.cc" ,
37
+ " flutter_tizen_texture_registrar.cc" ,
38
+ " key_event_handler.cc" ,
39
+ " tizen_event_loop.cc" ,
40
+ " tizen_renderer.cc" ,
41
+ " touch_event_handler.cc" ,
42
+ ]
43
+
44
+ _libs_minimum = [
45
+ " ecore" ,
46
+ " ecore_imf" ,
47
+ " ecore_input" ,
48
+ " eina" ,
49
+ " wayland-client" ,
50
+ ]
51
+
27
52
_public_headers = [
28
53
" public/flutter_platform_view.h" ,
29
54
" public/flutter_tizen.h" ,
@@ -33,42 +58,54 @@ _public_headers = [
33
58
# added to the compiler's search paths. Since we are not using the Tizen CLI
34
59
# builder, we have to add them manually.
35
60
config (" tizen_rootstrap_include_dirs" ) {
61
+ local_prefix = " $custom_sysroot /usr"
62
+
63
+ if (enable_desktop_embeddings && target_cpu == " x64" ) {
64
+ defines = [ " __X64_SHELL__" ]
65
+ local_prefix += " /local"
66
+ }
67
+
36
68
include_dirs = [
37
- " $custom_sysroot /usr /include" ,
38
- " $custom_sysroot /usr /include/appfw" ,
39
- " $custom_sysroot /usr /include/base" ,
40
- " $custom_sysroot /usr /include/dlog" ,
41
- " $custom_sysroot /usr /include/ecore-1" ,
42
- " $custom_sysroot /usr /include/ecore-imf-1" ,
43
- " $custom_sysroot /usr /include/ecore-input-1" ,
44
- " $custom_sysroot /usr /include/ecore-wayland-1" ,
45
- " $custom_sysroot /usr /include/ecore-wl2-1" ,
46
- " $custom_sysroot /usr /include/efl-1" ,
47
- " $custom_sysroot /usr /include/eina-1" ,
48
- " $custom_sysroot /usr /include/eina-1/eina" ,
49
- " $custom_sysroot /usr /include/emile-1" ,
50
- " $custom_sysroot /usr /include/eo-1" ,
51
- " $custom_sysroot /usr /include/feedback" ,
52
- " $custom_sysroot /usr /include/system" ,
53
- " $custom_sysroot /usr /include/wayland-extension" ,
69
+ local_prefix + " /include" ,
70
+ local_prefix + " /include/appfw" ,
71
+ local_prefix + " /include/base" ,
72
+ local_prefix + " /include/dlog" ,
73
+ local_prefix + " /include/ecore-1" ,
74
+ local_prefix + " /include/ecore-imf-1" ,
75
+ local_prefix + " /include/ecore-input-1" ,
76
+ local_prefix + " /include/ecore-wayland-1" ,
77
+ local_prefix + " /include/ecore-wl2-1" ,
78
+ local_prefix + " /include/efl-1" ,
79
+ local_prefix + " /include/eina-1" ,
80
+ local_prefix + " /include/eina-1/eina" ,
81
+ local_prefix + " /include/emile-1" ,
82
+ local_prefix + " /include/eo-1" ,
83
+ local_prefix + " /include/feedback" ,
84
+ local_prefix + " /include/system" ,
85
+ local_prefix + " /include/wayland-extension" ,
54
86
]
55
87
56
88
# Contain headers that the Evas_GL renderer depends on.
57
89
include_dirs += [
58
- " $custom_sysroot /usr /include/ecore-con-1" ,
59
- " $custom_sysroot /usr /include/ecore-evas-1" ,
60
- " $custom_sysroot /usr /include/ecore-file-1" ,
61
- " $custom_sysroot /usr /include/edje-1" ,
62
- " $custom_sysroot /usr /include/eet-1" ,
63
- " $custom_sysroot /usr /include/efl-1/interfaces" ,
64
- " $custom_sysroot /usr /include/efreet-1" ,
65
- " $custom_sysroot /usr /include/elementary-1" ,
66
- " $custom_sysroot /usr /include/ethumb-1" ,
67
- " $custom_sysroot /usr /include/ethumb-client-1" ,
68
- " $custom_sysroot /usr /include/evas-1" ,
90
+ local_prefix + " /include/ecore-con-1" ,
91
+ local_prefix + " /include/ecore-evas-1" ,
92
+ local_prefix + " /include/ecore-file-1" ,
93
+ local_prefix + " /include/edje-1" ,
94
+ local_prefix + " /include/eet-1" ,
95
+ local_prefix + " /include/efl-1/interfaces" ,
96
+ local_prefix + " /include/efreet-1" ,
97
+ local_prefix + " /include/elementary-1" ,
98
+ local_prefix + " /include/ethumb-1" ,
99
+ local_prefix + " /include/ethumb-client-1" ,
100
+ local_prefix + " /include/evas-1" ,
69
101
]
70
102
71
- lib_dirs = [ " $custom_sysroot /usr/lib" ]
103
+ if (enable_desktop_embeddings && target_cpu == " x64" ) {
104
+ include_dirs += [ local_prefix + " /include/eldbus-1" ]
105
+ lib_dirs = [ local_prefix + " /lib/x86_64-linux-gnu" ]
106
+ } else {
107
+ lib_dirs = [ local_prefix + " /lib" ]
108
+ }
72
109
}
73
110
74
111
# Template for the embedder build. Used to generate embedders for different
@@ -86,48 +123,37 @@ template("embedder_for_profile") {
86
123
shared_library (" flutter_tizen_${ target_name } " ) {
87
124
public = _public_headers
88
125
89
- sources = [
90
- " channels/key_event_channel.cc" ,
91
- " channels/lifecycle_channel.cc" ,
126
+ sources = _flutter_tizen_source
127
+ sources += [
92
128
" channels/localization_channel.cc" ,
93
- " channels/navigation_channel.cc" ,
94
129
" channels/platform_channel.cc" ,
95
- " channels/platform_view_channel.cc" ,
96
130
" channels/settings_channel.cc" ,
97
- " channels/text_input_channel.cc" ,
98
131
" external_texture_pixel_gl.cc" ,
99
132
" external_texture_surface_gl.cc" ,
100
- " flutter_tizen.cc" ,
101
- " flutter_tizen_engine.cc" ,
102
- " flutter_tizen_texture_registrar.cc" ,
103
- " key_event_handler.cc" ,
104
- " tizen_event_loop.cc" ,
105
133
" tizen_log.cc" ,
106
- " tizen_renderer.cc" ,
107
- " touch_event_handler.cc" ,
108
134
]
109
135
110
- libs = [
111
- " base-utils-i18n " ,
112
- " capi-appfw-application " ,
113
- " capi-base-common " ,
114
- " capi-system-system-settings " ,
115
- " dlog " ,
116
- " ecore " ,
117
- " ecore_imf " ,
118
- " ecore_input " ,
119
- " eina " ,
120
- " EGL " ,
121
- " feedback " ,
122
- " GLESv2 " ,
123
- " tbm " ,
124
- " tdm-client " ,
125
- " wayland-client " ,
126
- ]
136
+ libs = _libs_minimum
137
+
138
+ if ( ! enable_desktop_embeddings ) {
139
+ libs += [
140
+ " base-utils-i18n " ,
141
+ " capi-appfw-application " ,
142
+ " capi-base-common " ,
143
+ " capi-system-info " ,
144
+ " capi-system-system-settings " ,
145
+ " dlog " ,
146
+ " feedback " ,
147
+ " tbm " ,
148
+ " tdm-client " ,
149
+ " EGL " ,
150
+ " GLESv2 " ,
151
+ ]
152
+ }
127
153
128
154
defines = invoker .defines
129
155
130
- if (use_evas_gl_renderer ) {
156
+ if (use_evas_gl_renderer || enable_desktop_embeddings ) {
131
157
sources += [ " tizen_renderer_evas_gl.cc" ]
132
158
133
159
libs += [
@@ -167,6 +193,11 @@ template("embedder_for_profile") {
167
193
" //flutter/shell/platform/common/client_wrapper:client_wrapper" ,
168
194
" //third_party/rapidjson" ,
169
195
]
196
+
197
+ if (enable_desktop_embeddings ) {
198
+ deps +=
199
+ [ " //flutter/shell/platform/embedder:embedder_as_internal_library" ]
200
+ }
170
201
}
171
202
}
172
203
@@ -188,6 +219,102 @@ embedder_for_profile("common") {
188
219
defines = [ " COMMON_PROFILE" ]
189
220
}
190
221
222
+ test_fixtures (" flutter_tizen_fixtures" ) {
223
+ fixtures = []
224
+ }
225
+
226
+ template (" embedder_executable" ) {
227
+ forward_variables_from (invoker , [ " unit_test" ])
228
+
229
+ if (! defined (unit_test )) {
230
+ unit_test = false
231
+ }
232
+
233
+ executable (" ${ target_name } " ) {
234
+ if (unit_test ) {
235
+ testonly = true
236
+ }
237
+
238
+ public = _public_headers
239
+
240
+ sources = _flutter_tizen_source
241
+ sources += [
242
+ " channels/localization_channel_stub.cc" ,
243
+ " channels/platform_channel_stub.cc" ,
244
+ " channels/settings_channel_stub.cc" ,
245
+ " tizen_log_stub.cc" ,
246
+ " tizen_renderer_evas_gl.cc" ,
247
+ ]
248
+
249
+ if (defined (invoker .sources )) {
250
+ sources += invoker .sources
251
+ }
252
+
253
+ libs = _libs_minimum
254
+
255
+ libs += [
256
+ " ecore_evas" ,
257
+ " elementary" ,
258
+ " evas" ,
259
+ ]
260
+
261
+ defines = [ " TIZEN_RENDERER_EVAS_GL" ]
262
+
263
+ cflags_cc = [
264
+ " -Wno-newline-eof" ,
265
+ " -Wno-macro-redefined" ,
266
+ ]
267
+
268
+ public_configs = [ " //flutter:config" ]
269
+
270
+ configs += [
271
+ " :tizen_rootstrap_include_dirs" ,
272
+ " //flutter/shell/platform/common:desktop_library_implementation" ,
273
+ ]
274
+
275
+ deps = [
276
+ " //flutter/runtime:libdart" ,
277
+ " //flutter/shell/platform/common:common_cpp" ,
278
+ " //flutter/shell/platform/common:common_cpp_input" ,
279
+ " //flutter/shell/platform/common:common_cpp_library_headers" ,
280
+ " //flutter/shell/platform/common/client_wrapper:client_wrapper" ,
281
+ " //flutter/shell/platform/embedder:embedder_headers" ,
282
+ " //third_party/rapidjson" ,
283
+ ]
284
+
285
+ if (defined (invoker .deps )) {
286
+ deps += invoker .deps
287
+ }
288
+
289
+ if (defined (invoker .public_deps )) {
290
+ public_deps = invoker .public_deps
291
+ }
292
+ }
293
+ }
294
+
295
+ embedder_executable (" flutter_tizen_unittests" ) {
296
+ unit_test = true
297
+
298
+ sources = [
299
+ " flutter_tizen_engine_unittest.cc" ,
300
+ " testing/mock_engine.cc" ,
301
+ ]
302
+
303
+ public_deps = [ " //third_party/googletest:gtest" ]
304
+
305
+ deps = [
306
+ " :flutter_tizen_fixtures" ,
307
+ " //flutter/shell/platform/embedder:embedder_test_utils" ,
308
+ " //flutter/testing" ,
309
+ ]
310
+ }
311
+
312
+ embedder_executable (" flutter_tizen_shell" ) {
313
+ sources = [ " flutter_tizen_shell.cc" ]
314
+
315
+ public_deps = [ " :flutter_engine" ]
316
+ }
317
+
191
318
publish_client_wrapper_core (" publish_cpp_client_wrapper" ) {
192
319
visibility = [ " :*" ]
193
320
}
@@ -216,11 +343,17 @@ copy("copy_icu") {
216
343
group (" tizen" ) {
217
344
deps = [
218
345
" :copy_icu" ,
219
- " :flutter_tizen_common" ,
220
- " :flutter_tizen_mobile" ,
221
- " :flutter_tizen_tv" ,
222
- " :flutter_tizen_wearable" ,
223
346
" :publish_cpp_client_wrapper" ,
224
347
" :publish_headers_tizen" ,
225
348
]
349
+ if (enable_desktop_embeddings ) {
350
+ deps += [ " :flutter_tizen_shell" ]
351
+ } else {
352
+ deps += [
353
+ " :flutter_tizen_common" ,
354
+ " :flutter_tizen_mobile" ,
355
+ " :flutter_tizen_tv" ,
356
+ " :flutter_tizen_wearable" ,
357
+ ]
358
+ }
226
359
}
0 commit comments