11# Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved.
2- # Copyright 2013 The Flutter Authors. All rights reserved.
32# Use of this source code is governed by a BSD-style license that can be
43# found in the LICENSE file.
5- import (" //flutter/shell/platform/tizen/config.gni" )
6-
7- group (" tizen" ) {
8- deps = [ " :flutter_tizen_library" ]
9- }
104
11- shared_library ( " flutter_tizen_library " ) {
12- output_name = " flutter_tizen "
5+ import ( " //flutter/shell/platform/common/cpp/client_wrapper/publish.gni " )
6+ import ( " //flutter/shell/platform/tizen/config.gni " )
137
8+ # Sets the rpath of dependent targets (shared libs) to $ORIGIN.
9+ # We assume that the flutter_engine library exists next to the embedder library
10+ # when they are deployed on Tizen devices.
11+ config (" tizen_embedder_rpath" ) {
1412 ldflags = [ " -Wl,-rpath,\$ ORIGIN" ]
15-
16- deps = [ " :flutter_tizen" ]
17-
18- public_configs = [ " //flutter:config" ]
1913}
2014
21- source_set (" flutter_tizen_headers" ) {
22- public = [
23- " public/flutter_platform_view.h" ,
24- " public/flutter_tizen_texture_registrar.h" ,
25- " public/flutter_tizen.h" ,
26- ]
15+ source_set (" flutter_engine" ) {
16+ visibility = [ " :*" ]
2717
28- public_deps =
29- [ " //flutter/shell/platform/common/cpp:common_cpp_library_headers" ]
18+ libs = [ " flutter_engine" ]
3019
31- configs +=
32- [ " //flutter/shell/platform/common/cpp:desktop_library_implementation" ]
20+ lib_dirs = [ root_out_dir ]
3321
34- public_configs =
35- [ " //flutter/shell/platform/common/cpp:relative_flutter_library_headers" ]
36- }
37-
38- source_set (" flutter_tizen" ) {
39- sources = [
40- " channels/key_event_channel.cc" ,
41- " channels/lifecycle_channel.cc" ,
42- " channels/localization_channel.cc" ,
43- " channels/navigation_channel.cc" ,
44- " channels/platform_channel.cc" ,
45- " channels/platform_view_channel.cc" ,
46- " channels/settings_channel.cc" ,
47- " channels/text_input_channel.cc" ,
48- " external_texture_gl.cc" ,
49- " flutter_tizen.cc" ,
50- " key_event_handler.cc" ,
51- " tizen_embedder_engine.cc" ,
52- " tizen_event_loop.cc" ,
53- " tizen_log.cc" ,
54- " tizen_renderer.cc" ,
55- " tizen_vsync_waiter.cc" ,
56- " touch_event_handler.cc" ,
57- ]
22+ public_configs = [ " :tizen_embedder_rpath" ]
5823
59- configs +=
60- [ " //flutter/shell/platform/common/cpp:desktop_library_implementation " ]
24+ deps = [ " //flutter/shell/platform/embedder:flutter_engine " ]
25+ }
6126
62- deps = [
63- " :flutter_tizen_headers" ,
64- " //flutter/shell/platform/common/cpp:common_cpp" ,
65- " //flutter/shell/platform/common/cpp:common_cpp_input" ,
66- " //flutter/shell/platform/common/cpp/client_wrapper:client_wrapper" ,
67- " //flutter/shell/platform/embedder:flutter_engine" ,
68- " //third_party/rapidjson" ,
69- ]
27+ _public_headers = [
28+ " public/flutter_platform_view.h" ,
29+ " public/flutter_tizen_texture_registrar.h" ,
30+ " public/flutter_tizen.h" ,
31+ ]
7032
33+ # Tizen native headers assume that the following include dirs are already
34+ # added to the compiler's search paths. Since we are not using the Tizen CLI
35+ # builder, we have to add them manually.
36+ config (" tizen_rootstrap_include_dirs" ) {
7137 include_dirs = [
7238 " $custom_sysroot /usr/include" ,
7339 " $custom_sysroot /usr/include/appfw" ,
@@ -87,41 +53,169 @@ source_set("flutter_tizen") {
8753 " $custom_sysroot /usr/include/eo-1" ,
8854 " $custom_sysroot /usr/include/evas-1" ,
8955 " $custom_sysroot /usr/include/system" ,
90- " $custom_sysroot /usr/include/wayland-extension"
56+ " $custom_sysroot /usr/include/wayland-extension" ,
57+ # For Evas_GL.
58+ " $custom_sysroot /usr/include/ecore-con-1" ,
59+ " $custom_sysroot /usr/include/ecore-file-1" ,
60+ " $custom_sysroot /usr/include/edje-1" ,
61+ " $custom_sysroot /usr/include/eet-1" ,
62+ " $custom_sysroot /usr/include/efl-1/interfaces" ,
63+ " $custom_sysroot /usr/include/efreet-1" ,
64+ " $custom_sysroot /usr/include/elementary-1" ,
65+ " $custom_sysroot /usr/include/ethumb-1" ,
66+ " $custom_sysroot /usr/include/ethumb-client-1" ,
9167 ]
92-
93- lib_dirs = [ root_out_dir , " $custom_sysroot /usr/lib" ]
9468
95- cflags_cc = [
96- " -Wno-newline-eof" ,
97- " -Wno-macro-redefined" ,
98- ]
69+ lib_dirs = [ " $custom_sysroot /usr/lib" ]
70+ }
9971
100- libs = [
101- " base-utils-i18n" ,
102- " capi-appfw-application" ,
103- " capi-system-info" ,
104- " capi-system-system-settings" ,
105- " dlog" ,
106- " ecore" ,
107- " ecore_imf" ,
108- " ecore_input" ,
109- " eina" ,
110- " EGL" ,
111- " evas" ,
112- " flutter_engine" ,
113- " GLESv2" ,
114- " tbm" ,
115- " tdm-client" ,
116- " wayland-client" ,
117- ]
72+ # Template for the embedder build. Used to generate embedders for different
73+ # device profiles. The output library name is "flutter_tizen_[profile]".
74+ #
75+ # If use_evas_gl_renderer is provided as true, the Evas_GL renderer is used,
76+ # otherwise the Ecore_Wl2 renderer is used.
77+ template (" embedder_for_profile" ) {
78+ forward_variables_from (invoker , [ " use_evas_gl_renderer" ])
11879
119- if (tizen_sdk_4 ) {
120- sources += [ " tizen_renderer_ecore_wl.cc" ]
121- libs += [ " ecore_wayland" , " wayland-egl" ]
122- defines = [ " FLUTTER_TIZEN_4" ]
123- } else {
124- sources += [ " tizen_renderer_ecore_wl2.cc" ]
125- libs += [ " ecore_wl2" ]
80+ if (! defined (use_evas_gl_renderer )) {
81+ use_evas_gl_renderer = false
12682 }
83+
84+ shared_library (" flutter_tizen_${ target_name } " ) {
85+ public = _public_headers
86+
87+ sources = [
88+ " channels/key_event_channel.cc" ,
89+ " channels/lifecycle_channel.cc" ,
90+ " channels/localization_channel.cc" ,
91+ " channels/navigation_channel.cc" ,
92+ " channels/platform_channel.cc" ,
93+ " channels/platform_view_channel.cc" ,
94+ " channels/settings_channel.cc" ,
95+ " channels/text_input_channel.cc" ,
96+ " external_texture_gl.cc" ,
97+ " flutter_tizen.cc" ,
98+ " key_event_handler.cc" ,
99+ " tizen_embedder_engine.cc" ,
100+ " tizen_event_loop.cc" ,
101+ " tizen_log.cc" ,
102+ " tizen_renderer.cc" ,
103+ " touch_event_handler.cc" ,
104+ ]
105+
106+ libs = [
107+ " base-utils-i18n" ,
108+ " capi-appfw-application" ,
109+ " capi-system-info" ,
110+ " capi-system-system-settings" ,
111+ " dlog" ,
112+ " ecore" ,
113+ " ecore_imf" ,
114+ " ecore_input" ,
115+ " eina" ,
116+ " evas" ,
117+ " EGL" ,
118+ " GLESv2" ,
119+ " tbm" ,
120+ " tdm-client" ,
121+ " wayland-client" ,
122+ ]
123+
124+ defines = invoker .defines
125+
126+ if (use_evas_gl_renderer ) {
127+ sources += [ " tizen_renderer_evas_gl.cc" ]
128+
129+ libs += [
130+ " ecore_evas" ,
131+ " elementary" ,
132+ ]
133+
134+ defines += [ " TIZEN_RENDERER_EVAS_GL" ]
135+ } else {
136+ sources += [
137+ " tizen_renderer_ecore_wl2.cc" ,
138+ " tizen_vsync_waiter.cc" ,
139+ ]
140+
141+ libs += [ " ecore_wl2" ]
142+ }
143+
144+ cflags_cc = [
145+ " -Wno-newline-eof" ,
146+ " -Wno-macro-redefined" ,
147+ ]
148+
149+ configs += [
150+ " :tizen_rootstrap_include_dirs" ,
151+ " //flutter/shell/platform/common/cpp:desktop_library_implementation"
152+ ]
153+
154+ public_configs = [ " //flutter:config" ]
155+
156+ public_deps = [ " :flutter_engine" ]
157+
158+ deps = [
159+ " //flutter/shell/platform/common/cpp:common_cpp" ,
160+ " //flutter/shell/platform/common/cpp:common_cpp_input" ,
161+ " //flutter/shell/platform/common/cpp:common_cpp_library_headers" ,
162+ " //flutter/shell/platform/common/cpp/client_wrapper:client_wrapper" ,
163+ " //third_party/rapidjson" ,
164+ ]
165+ }
166+ }
167+
168+ embedder_for_profile (" mobile" ) {
169+ defines = [ " MOBILE_PROFILE" ]
170+ }
171+
172+ embedder_for_profile (" wearable" ) {
173+ defines = [ " WEARABLE_PROFILE" ]
174+
175+ use_evas_gl_renderer = true
176+ }
177+
178+ embedder_for_profile (" tv" ) {
179+ defines = [ " TV_PROFILE" ]
180+ }
181+
182+ embedder_for_profile (" common" ) {
183+ defines = [ " COMMON_PROFILE" ]
184+ }
185+
186+ publish_client_wrapper_core (" publish_cpp_client_wrapper" ) {
187+ visibility = [ " :*" ]
188+ }
189+
190+ _common_cpp_public_headers = [
191+ " //flutter/shell/platform/common/cpp/public/flutter_export.h" ,
192+ " //flutter/shell/platform/common/cpp/public/flutter_messenger.h" ,
193+ " //flutter/shell/platform/common/cpp/public/flutter_plugin_registrar.h" ,
194+ " //flutter/shell/platform/common/cpp/public/flutter_texture_registrar.h" ,
195+ ]
196+
197+ copy (" publish_headers_tizen" ) {
198+ sources = _public_headers + _common_cpp_public_headers
199+
200+ outputs = [ " $root_out_dir /public/{{source_file_part}}" ]
201+ }
202+
203+ copy (" copy_icu" ) {
204+ visibility = [ " :*" ]
205+
206+ sources = [ " //third_party/icu/flutter/icudtl.dat" ]
207+
208+ outputs = [ " $root_out_dir /icu/{{source_file_part}}" ]
209+ }
210+
211+ group (" tizen" ) {
212+ deps = [
213+ " :flutter_tizen_mobile" ,
214+ " :flutter_tizen_wearable" ,
215+ " :flutter_tizen_tv" ,
216+ " :flutter_tizen_common" ,
217+ " :publish_cpp_client_wrapper" ,
218+ " :publish_headers_tizen" ,
219+ " :copy_icu" ,
220+ ]
127221}
0 commit comments