Skip to content

Commit

Permalink
Enable x64(pc) build for tizen shell
Browse files Browse the repository at this point in the history
Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Use enable_desktop_embeddings instead of embedder_for_pc

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Co-authored-by: Swift Kim <swift.kim@samsung.com>

Add flutter_tizen_engine TC

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Add basic shell for test

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Introduce mock_engine for unittest

* copied from linux port ('/shell/platform/linux/testing/mock_engine.cc')

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Code clean-up && Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Clean up shell/platform/tizen/BUILD.gn

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

Clean up shell/platform/tizen/BUILD.gn #2

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

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 <mh.byun@samsung.com>

Fix minor thing

* Change ecore lib path at X64 shell
* Refactor log function dummy
* Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
  • Loading branch information
bwikbs committed Jul 5, 2021
1 parent a7ea781 commit d1f0815
Show file tree
Hide file tree
Showing 26 changed files with 1,693 additions and 76 deletions.
5 changes: 5 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import("//flutter/common/config.gni")
import("//flutter/shell/platform/config.gni")
import("//flutter/shell/platform/glfw/config.gni")
import("//flutter/shell/platform/tizen/config.gni")
import("//flutter/testing/testing.gni")

# Whether to build the dartdevc sdk, libraries, and source files
Expand Down Expand Up @@ -159,6 +160,10 @@ group("flutter") {
public_deps +=
[ "//flutter/shell/platform/glfw:flutter_glfw_unittests" ]
}
if (build_tizen_shell) {
public_deps +=
[ "//flutter/shell/platform/tizen:flutter_tizen_unittests" ]
}
}

if (is_mac) {
Expand Down
5 changes: 2 additions & 3 deletions shell/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ group("platform") {
deps = [ "android" ]
} else if (is_linux) {
deps = []
if (enable_desktop_embeddings) {
deps += [ "linux" ]
}
if (build_tizen_shell) {
deps += [ "tizen" ]
} else if (enable_desktop_embeddings) {
deps += [ "linux" ]
}
} else if (is_win) {
deps = []
Expand Down
2 changes: 2 additions & 0 deletions shell/platform/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# found in the LICENSE file.

import("//flutter/common/config.gni")
import("//flutter/shell/platform/config.gni")
import("//flutter/shell/platform/tizen/config.gni")
import("//flutter/testing/testing.gni")

Expand Down Expand Up @@ -181,6 +182,7 @@ if (enable_unittests) {
":common_cpp_switches",
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/testing",
]

Expand Down
257 changes: 190 additions & 67 deletions shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# found in the LICENSE file.

import("//flutter/shell/platform/common/client_wrapper/publish.gni")
import("//flutter/shell/platform/config.gni")
import("//flutter/shell/platform/tizen/config.gni")
import("//flutter/testing/testing.gni")

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

_flutter_tizen_source = [
"channels/key_event_channel.cc",
"channels/lifecycle_channel.cc",
"channels/localization_channel.cc",
"channels/navigation_channel.cc",
"channels/platform_channel.cc",
"channels/platform_view_channel.cc",
"channels/settings_channel.cc",
"channels/text_input_channel.cc",
"external_texture_pixel_gl.cc",
"external_texture_surface_gl.cc",
"flutter_tizen.cc",
"flutter_tizen_engine.cc",
"flutter_tizen_texture_registrar.cc",
"key_event_handler.cc",
"tizen_event_loop.cc",
"tizen_log.cc",
"tizen_renderer.cc",
"touch_event_handler.cc",
]

_libs_minimum = [
"ecore",
"ecore_imf",
"ecore_input",
"eina",
"wayland-client",
]

_public_headers = [
"public/flutter_platform_view.h",
"public/flutter_tizen.h",
Expand All @@ -33,42 +64,54 @@ _public_headers = [
# added to the compiler's search paths. Since we are not using the Tizen CLI
# builder, we have to add them manually.
config("tizen_rootstrap_include_dirs") {
local_prefix = "$custom_sysroot/usr"

if (enable_desktop_embeddings && target_cpu == "x64") {
defines = [ "__X64_SHELL__" ]
local_prefix += "/local"
}

include_dirs = [
"$custom_sysroot/usr/include",
"$custom_sysroot/usr/include/appfw",
"$custom_sysroot/usr/include/base",
"$custom_sysroot/usr/include/dlog",
"$custom_sysroot/usr/include/ecore-1",
"$custom_sysroot/usr/include/ecore-imf-1",
"$custom_sysroot/usr/include/ecore-input-1",
"$custom_sysroot/usr/include/ecore-wayland-1",
"$custom_sysroot/usr/include/ecore-wl2-1",
"$custom_sysroot/usr/include/efl-1",
"$custom_sysroot/usr/include/eina-1",
"$custom_sysroot/usr/include/eina-1/eina",
"$custom_sysroot/usr/include/emile-1",
"$custom_sysroot/usr/include/eo-1",
"$custom_sysroot/usr/include/feedback",
"$custom_sysroot/usr/include/system",
"$custom_sysroot/usr/include/wayland-extension",
local_prefix + "/include",
local_prefix + "/include/appfw",
local_prefix + "/include/base",
local_prefix + "/include/dlog",
local_prefix + "/include/ecore-1",
local_prefix + "/include/ecore-imf-1",
local_prefix + "/include/ecore-input-1",
local_prefix + "/include/ecore-wayland-1",
local_prefix + "/include/ecore-wl2-1",
local_prefix + "/include/efl-1",
local_prefix + "/include/eina-1",
local_prefix + "/include/eina-1/eina",
local_prefix + "/include/emile-1",
local_prefix + "/include/eo-1",
local_prefix + "/include/feedback",
local_prefix + "/include/system",
local_prefix + "/include/wayland-extension",
]

# Contain headers that the Evas_GL renderer depends on.
include_dirs += [
"$custom_sysroot/usr/include/ecore-con-1",
"$custom_sysroot/usr/include/ecore-evas-1",
"$custom_sysroot/usr/include/ecore-file-1",
"$custom_sysroot/usr/include/edje-1",
"$custom_sysroot/usr/include/eet-1",
"$custom_sysroot/usr/include/efl-1/interfaces",
"$custom_sysroot/usr/include/efreet-1",
"$custom_sysroot/usr/include/elementary-1",
"$custom_sysroot/usr/include/ethumb-1",
"$custom_sysroot/usr/include/ethumb-client-1",
"$custom_sysroot/usr/include/evas-1",
local_prefix + "/include/ecore-con-1",
local_prefix + "/include/ecore-evas-1",
local_prefix + "/include/ecore-file-1",
local_prefix + "/include/edje-1",
local_prefix + "/include/eet-1",
local_prefix + "/include/efl-1/interfaces",
local_prefix + "/include/efreet-1",
local_prefix + "/include/elementary-1",
local_prefix + "/include/ethumb-1",
local_prefix + "/include/ethumb-client-1",
local_prefix + "/include/evas-1",
]

lib_dirs = [ "$custom_sysroot/usr/lib" ]
if (enable_desktop_embeddings && target_cpu == "x64") {
include_dirs += [ local_prefix + "/include/eldbus-1" ]
lib_dirs = [ local_prefix + "/lib/x86_64-linux-gnu" ]
} else {
lib_dirs = [ local_prefix + "/lib" ]
}
}

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

sources = [
"channels/key_event_channel.cc",
"channels/lifecycle_channel.cc",
"channels/localization_channel.cc",
"channels/navigation_channel.cc",
"channels/platform_channel.cc",
"channels/platform_view_channel.cc",
"channels/settings_channel.cc",
"channels/text_input_channel.cc",
"external_texture_pixel_gl.cc",
"external_texture_surface_gl.cc",
"flutter_tizen.cc",
"flutter_tizen_engine.cc",
"flutter_tizen_texture_registrar.cc",
"key_event_handler.cc",
"tizen_event_loop.cc",
"tizen_log.cc",
"tizen_renderer.cc",
"touch_event_handler.cc",
]
sources = _flutter_tizen_source

libs = [
"base-utils-i18n",
"capi-appfw-application",
"capi-base-common",
"capi-system-system-settings",
"dlog",
"ecore",
"ecore_imf",
"ecore_input",
"eina",
"EGL",
"feedback",
"GLESv2",
"tbm",
"tdm-client",
"wayland-client",
]
libs = _libs_minimum

if (!enable_desktop_embeddings) {
libs += [
"base-utils-i18n",
"capi-appfw-application",
"capi-base-common",
"capi-system-info",
"capi-system-system-settings",
"dlog",
"feedback",
"tbm",
"tdm-client",
"EGL",
"GLESv2",
]
}

defines = invoker.defines

if (use_evas_gl_renderer) {
if (use_evas_gl_renderer || enable_desktop_embeddings) {
sources += [ "tizen_renderer_evas_gl.cc" ]

libs += [
Expand Down Expand Up @@ -167,6 +191,11 @@ template("embedder_for_profile") {
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//third_party/rapidjson",
]

if (enable_desktop_embeddings) {
deps +=
[ "//flutter/shell/platform/embedder:embedder_as_internal_library" ]
}
}
}

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

test_fixtures("flutter_tizen_fixtures") {
fixtures = []
}

template("embedder_executable") {
forward_variables_from(invoker, [ "unit_test" ])

if (!defined(unit_test)) {
unit_test = false
}

executable("${target_name}") {
if (unit_test) {
testonly = true
}

public = _public_headers

sources = _flutter_tizen_source

sources += [ "tizen_renderer_evas_gl.cc" ]

if (defined(invoker.sources)) {
sources += invoker.sources
}

libs = _libs_minimum

libs += [
"ecore_evas",
"elementary",
"evas",
]

defines = [ "TIZEN_RENDERER_EVAS_GL" ]

cflags_cc = [
"-Wno-newline-eof",
"-Wno-macro-redefined",
]

public_configs = [ "//flutter:config" ]

configs += [
":tizen_rootstrap_include_dirs",
"//flutter/shell/platform/common:desktop_library_implementation",
]

deps = [
"//flutter/runtime:libdart",
"//flutter/shell/platform/common:common_cpp",
"//flutter/shell/platform/common:common_cpp_input",
"//flutter/shell/platform/common:common_cpp_library_headers",
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/embedder:embedder_headers",
"//third_party/rapidjson",
]

if (defined(invoker.deps)) {
deps += invoker.deps
}

if (defined(invoker.public_deps)) {
public_deps = invoker.public_deps
}
}
}

embedder_executable("flutter_tizen_unittests") {
unit_test = true

sources = [
"flutter_tizen_engine_unittest.cc",
"testing/mock_engine.cc",
]

public_deps = [ "//third_party/googletest:gtest" ]

deps = [
":flutter_tizen_fixtures",
"//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/testing",
]
}

embedder_executable("flutter_tizen_shell") {
sources = [ "flutter_tizen_shell.cc" ]

public_deps = [ ":flutter_engine" ]
}

publish_client_wrapper_core("publish_cpp_client_wrapper") {
visibility = [ ":*" ]
}
Expand Down Expand Up @@ -223,4 +343,7 @@ group("tizen") {
":publish_cpp_client_wrapper",
":publish_headers_tizen",
]
if (enable_desktop_embeddings) {
deps += [ ":flutter_tizen_shell" ]
}
}
Loading

0 comments on commit d1f0815

Please sign in to comment.