Skip to content

Commit d1f0815

Browse files
committed
Enable x64(pc) build for tizen shell
Signed-off-by: MuHong Byun <[email protected]> Use enable_desktop_embeddings instead of embedder_for_pc Signed-off-by: MuHong Byun <[email protected]> Co-authored-by: Swift Kim <[email protected]> Add flutter_tizen_engine TC Signed-off-by: MuHong Byun <[email protected]> Add basic shell for test Signed-off-by: MuHong Byun <[email protected]> Introduce mock_engine for unittest * copied from linux port ('/shell/platform/linux/testing/mock_engine.cc') Signed-off-by: MuHong Byun <[email protected]> Apply review's comment Signed-off-by: MuHong Byun <[email protected]> Code clean-up && Apply review's comment Signed-off-by: MuHong Byun <[email protected]> Clean up shell/platform/tizen/BUILD.gn Signed-off-by: MuHong Byun <[email protected]> Clean up shell/platform/tizen/BUILD.gn #2 Signed-off-by: MuHong Byun <[email protected]> Add EvasGL Helper for x64 shell build * This file is the same file as Evas_GL_GLES3_Helpers.h in tizen. Signed-off-by: MuHong Byun <[email protected]> Fix minor thing * Change ecore lib path at X64 shell * Refactor log function dummy * Apply review's comment Signed-off-by: MuHong Byun <[email protected]>
1 parent a7ea781 commit d1f0815

26 files changed

+1693
-76
lines changed

BUILD.gn

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import("//flutter/common/config.gni")
66
import("//flutter/shell/platform/config.gni")
77
import("//flutter/shell/platform/glfw/config.gni")
8+
import("//flutter/shell/platform/tizen/config.gni")
89
import("//flutter/testing/testing.gni")
910

1011
# Whether to build the dartdevc sdk, libraries, and source files
@@ -159,6 +160,10 @@ group("flutter") {
159160
public_deps +=
160161
[ "//flutter/shell/platform/glfw:flutter_glfw_unittests" ]
161162
}
163+
if (build_tizen_shell) {
164+
public_deps +=
165+
[ "//flutter/shell/platform/tizen:flutter_tizen_unittests" ]
166+
}
162167
}
163168

164169
if (is_mac) {

shell/platform/BUILD.gn

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ group("platform") {
1313
deps = [ "android" ]
1414
} else if (is_linux) {
1515
deps = []
16-
if (enable_desktop_embeddings) {
17-
deps += [ "linux" ]
18-
}
1916
if (build_tizen_shell) {
2017
deps += [ "tizen" ]
18+
} else if (enable_desktop_embeddings) {
19+
deps += [ "linux" ]
2120
}
2221
} else if (is_win) {
2322
deps = []

shell/platform/common/BUILD.gn

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# found in the LICENSE file.
44

55
import("//flutter/common/config.gni")
6+
import("//flutter/shell/platform/config.gni")
67
import("//flutter/shell/platform/tizen/config.gni")
78
import("//flutter/testing/testing.gni")
89

@@ -181,6 +182,7 @@ if (enable_unittests) {
181182
":common_cpp_switches",
182183
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
183184
"//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs",
185+
"//flutter/shell/platform/embedder:embedder_as_internal_library",
184186
"//flutter/testing",
185187
]
186188

shell/platform/tizen/BUILD.gn

+190-67
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# found in the LICENSE file.
44

55
import("//flutter/shell/platform/common/client_wrapper/publish.gni")
6+
import("//flutter/shell/platform/config.gni")
67
import("//flutter/shell/platform/tizen/config.gni")
8+
import("//flutter/testing/testing.gni")
79

810
# Sets the rpath of dependent targets (shared libs) to $ORIGIN.
911
# We assume that the flutter_engine library exists next to the embedder library
@@ -24,6 +26,35 @@ source_set("flutter_engine") {
2426
deps = [ "//flutter/shell/platform/embedder:flutter_engine" ]
2527
}
2628

29+
_flutter_tizen_source = [
30+
"channels/key_event_channel.cc",
31+
"channels/lifecycle_channel.cc",
32+
"channels/localization_channel.cc",
33+
"channels/navigation_channel.cc",
34+
"channels/platform_channel.cc",
35+
"channels/platform_view_channel.cc",
36+
"channels/settings_channel.cc",
37+
"channels/text_input_channel.cc",
38+
"external_texture_pixel_gl.cc",
39+
"external_texture_surface_gl.cc",
40+
"flutter_tizen.cc",
41+
"flutter_tizen_engine.cc",
42+
"flutter_tizen_texture_registrar.cc",
43+
"key_event_handler.cc",
44+
"tizen_event_loop.cc",
45+
"tizen_log.cc",
46+
"tizen_renderer.cc",
47+
"touch_event_handler.cc",
48+
]
49+
50+
_libs_minimum = [
51+
"ecore",
52+
"ecore_imf",
53+
"ecore_input",
54+
"eina",
55+
"wayland-client",
56+
]
57+
2758
_public_headers = [
2859
"public/flutter_platform_view.h",
2960
"public/flutter_tizen.h",
@@ -33,42 +64,54 @@ _public_headers = [
3364
# added to the compiler's search paths. Since we are not using the Tizen CLI
3465
# builder, we have to add them manually.
3566
config("tizen_rootstrap_include_dirs") {
67+
local_prefix = "$custom_sysroot/usr"
68+
69+
if (enable_desktop_embeddings && target_cpu == "x64") {
70+
defines = [ "__X64_SHELL__" ]
71+
local_prefix += "/local"
72+
}
73+
3674
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",
75+
local_prefix + "/include",
76+
local_prefix + "/include/appfw",
77+
local_prefix + "/include/base",
78+
local_prefix + "/include/dlog",
79+
local_prefix + "/include/ecore-1",
80+
local_prefix + "/include/ecore-imf-1",
81+
local_prefix + "/include/ecore-input-1",
82+
local_prefix + "/include/ecore-wayland-1",
83+
local_prefix + "/include/ecore-wl2-1",
84+
local_prefix + "/include/efl-1",
85+
local_prefix + "/include/eina-1",
86+
local_prefix + "/include/eina-1/eina",
87+
local_prefix + "/include/emile-1",
88+
local_prefix + "/include/eo-1",
89+
local_prefix + "/include/feedback",
90+
local_prefix + "/include/system",
91+
local_prefix + "/include/wayland-extension",
5492
]
5593

5694
# Contain headers that the Evas_GL renderer depends on.
5795
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",
96+
local_prefix + "/include/ecore-con-1",
97+
local_prefix + "/include/ecore-evas-1",
98+
local_prefix + "/include/ecore-file-1",
99+
local_prefix + "/include/edje-1",
100+
local_prefix + "/include/eet-1",
101+
local_prefix + "/include/efl-1/interfaces",
102+
local_prefix + "/include/efreet-1",
103+
local_prefix + "/include/elementary-1",
104+
local_prefix + "/include/ethumb-1",
105+
local_prefix + "/include/ethumb-client-1",
106+
local_prefix + "/include/evas-1",
69107
]
70108

71-
lib_dirs = [ "$custom_sysroot/usr/lib" ]
109+
if (enable_desktop_embeddings && target_cpu == "x64") {
110+
include_dirs += [ local_prefix + "/include/eldbus-1" ]
111+
lib_dirs = [ local_prefix + "/lib/x86_64-linux-gnu" ]
112+
} else {
113+
lib_dirs = [ local_prefix + "/lib" ]
114+
}
72115
}
73116

74117
# Template for the embedder build. Used to generate embedders for different
@@ -86,48 +129,29 @@ template("embedder_for_profile") {
86129
shared_library("flutter_tizen_${target_name}") {
87130
public = _public_headers
88131

89-
sources = [
90-
"channels/key_event_channel.cc",
91-
"channels/lifecycle_channel.cc",
92-
"channels/localization_channel.cc",
93-
"channels/navigation_channel.cc",
94-
"channels/platform_channel.cc",
95-
"channels/platform_view_channel.cc",
96-
"channels/settings_channel.cc",
97-
"channels/text_input_channel.cc",
98-
"external_texture_pixel_gl.cc",
99-
"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-
"tizen_log.cc",
106-
"tizen_renderer.cc",
107-
"touch_event_handler.cc",
108-
]
132+
sources = _flutter_tizen_source
109133

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-
]
134+
libs = _libs_minimum
135+
136+
if (!enable_desktop_embeddings) {
137+
libs += [
138+
"base-utils-i18n",
139+
"capi-appfw-application",
140+
"capi-base-common",
141+
"capi-system-info",
142+
"capi-system-system-settings",
143+
"dlog",
144+
"feedback",
145+
"tbm",
146+
"tdm-client",
147+
"EGL",
148+
"GLESv2",
149+
]
150+
}
127151

128152
defines = invoker.defines
129153

130-
if (use_evas_gl_renderer) {
154+
if (use_evas_gl_renderer || enable_desktop_embeddings) {
131155
sources += [ "tizen_renderer_evas_gl.cc" ]
132156

133157
libs += [
@@ -167,6 +191,11 @@ template("embedder_for_profile") {
167191
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
168192
"//third_party/rapidjson",
169193
]
194+
195+
if (enable_desktop_embeddings) {
196+
deps +=
197+
[ "//flutter/shell/platform/embedder:embedder_as_internal_library" ]
198+
}
170199
}
171200
}
172201

@@ -188,6 +217,97 @@ embedder_for_profile("common") {
188217
defines = [ "COMMON_PROFILE" ]
189218
}
190219

220+
test_fixtures("flutter_tizen_fixtures") {
221+
fixtures = []
222+
}
223+
224+
template("embedder_executable") {
225+
forward_variables_from(invoker, [ "unit_test" ])
226+
227+
if (!defined(unit_test)) {
228+
unit_test = false
229+
}
230+
231+
executable("${target_name}") {
232+
if (unit_test) {
233+
testonly = true
234+
}
235+
236+
public = _public_headers
237+
238+
sources = _flutter_tizen_source
239+
240+
sources += [ "tizen_renderer_evas_gl.cc" ]
241+
242+
if (defined(invoker.sources)) {
243+
sources += invoker.sources
244+
}
245+
246+
libs = _libs_minimum
247+
248+
libs += [
249+
"ecore_evas",
250+
"elementary",
251+
"evas",
252+
]
253+
254+
defines = [ "TIZEN_RENDERER_EVAS_GL" ]
255+
256+
cflags_cc = [
257+
"-Wno-newline-eof",
258+
"-Wno-macro-redefined",
259+
]
260+
261+
public_configs = [ "//flutter:config" ]
262+
263+
configs += [
264+
":tizen_rootstrap_include_dirs",
265+
"//flutter/shell/platform/common:desktop_library_implementation",
266+
]
267+
268+
deps = [
269+
"//flutter/runtime:libdart",
270+
"//flutter/shell/platform/common:common_cpp",
271+
"//flutter/shell/platform/common:common_cpp_input",
272+
"//flutter/shell/platform/common:common_cpp_library_headers",
273+
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
274+
"//flutter/shell/platform/embedder:embedder_headers",
275+
"//third_party/rapidjson",
276+
]
277+
278+
if (defined(invoker.deps)) {
279+
deps += invoker.deps
280+
}
281+
282+
if (defined(invoker.public_deps)) {
283+
public_deps = invoker.public_deps
284+
}
285+
}
286+
}
287+
288+
embedder_executable("flutter_tizen_unittests") {
289+
unit_test = true
290+
291+
sources = [
292+
"flutter_tizen_engine_unittest.cc",
293+
"testing/mock_engine.cc",
294+
]
295+
296+
public_deps = [ "//third_party/googletest:gtest" ]
297+
298+
deps = [
299+
":flutter_tizen_fixtures",
300+
"//flutter/shell/platform/embedder:embedder_test_utils",
301+
"//flutter/testing",
302+
]
303+
}
304+
305+
embedder_executable("flutter_tizen_shell") {
306+
sources = [ "flutter_tizen_shell.cc" ]
307+
308+
public_deps = [ ":flutter_engine" ]
309+
}
310+
191311
publish_client_wrapper_core("publish_cpp_client_wrapper") {
192312
visibility = [ ":*" ]
193313
}
@@ -223,4 +343,7 @@ group("tizen") {
223343
":publish_cpp_client_wrapper",
224344
":publish_headers_tizen",
225345
]
346+
if (enable_desktop_embeddings) {
347+
deps += [ ":flutter_tizen_shell" ]
348+
}
226349
}

0 commit comments

Comments
 (0)