Skip to content

Commit 1f55131

Browse files
authored
Separate the embedder from the engine (#29)
* Split the output binary into two * Update the CI script
1 parent 02a7411 commit 1f55131

File tree

5 files changed

+64
-52
lines changed

5 files changed

+64
-52
lines changed

azure-pipelines.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
pool:
2727
name: Default
2828
demands: agent.os -equals Linux
29-
timeoutInMinutes: 30
29+
timeoutInMinutes: 60
3030
cancelTimeoutInMinutes: 1
3131
variables:
3232
- name: buildroot
@@ -38,6 +38,10 @@ jobs:
3838
git reset --hard HEAD
3939
gclient sync -D
4040
sed -i 's/"-Wno-non-c-typedef-for-linkage",//g' build/config/compiler/BUILD.gn
41+
displayName: Prepare for build
42+
workingDirectory: $(buildroot)
43+
failOnStderr: true
44+
- bash: |
4145
flutter/tools/gn \
4246
--target-os linux \
4347
--linux-cpu $(arch) \
@@ -46,19 +50,40 @@ jobs:
4650
--target-triple $(targetTriple) \
4751
--runtime-mode $(mode) \
4852
--embedder-for-target \
49-
--build-tizen-shell
50-
ninja -C out/linux_$(mode)_$(arch)
53+
--disable-desktop-embeddings \
54+
--build-tizen-shell \
55+
--out-dir output/default
56+
ninja -C output/default/out/linux_$(mode)_$(arch)
5157
displayName: Build
5258
workingDirectory: $(buildroot)
5359
failOnStderr: true
60+
- bash: |
61+
flutter/tools/gn \
62+
--target-os linux \
63+
--linux-cpu $(arch) \
64+
--target-toolchain `pwd`/tizen_tools/toolchains \
65+
--target-sysroot `pwd`/tizen_tools/sysroot/$(arch)_40 \
66+
--target-triple $(targetTriple) \
67+
--runtime-mode $(mode) \
68+
--embedder-for-target \
69+
--disable-desktop-embeddings \
70+
--build-tizen-shell \
71+
--tizen-sdk-4 \
72+
--out-dir output/tizen40
73+
ninja -C output/tizen40/out/linux_$(mode)_$(arch)
74+
displayName: Build for Tizen 4.0
75+
workingDirectory: $(buildroot)
76+
failOnStderr: true
5477
- bash: |
5578
OUTDIR=$(Build.StagingDirectory)
56-
cp libflutter_linux_tizen.so $OUTDIR/libflutter.so
79+
cp default/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR
80+
cp tizen40/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR/libflutter_tizen40.so
81+
cp tizen40/out/linux_$(mode)_$(arch)/libflutter_engine.so $OUTDIR
5782
if [ "$(System.JobName)" = "tizen-arm-release" ]; then
58-
cp icudtl.dat $OUTDIR
83+
cp default/out/linux_$(mode)_$(arch)/icudtl.dat $OUTDIR
5984
fi
6085
displayName: Copy artifacts
61-
workingDirectory: $(buildroot)/out/linux_$(mode)_$(arch)
86+
workingDirectory: $(buildroot)/output
6287
failOnStderr: true
6388
- publish: $(Build.StagingDirectory)
6489
artifact: $(System.JobName)

shell/platform/BUILD.gn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import("//build/fuchsia/sdk.gni")
66
import("//flutter/shell/platform/config.gni")
7+
import("//flutter/shell/platform/tizen/config.gni")
78

89
group("platform") {
910
if (is_mac || is_ios) {
@@ -15,6 +16,9 @@ group("platform") {
1516
if (enable_desktop_embeddings) {
1617
deps += [ "linux" ]
1718
}
19+
if (build_tizen_shell) {
20+
deps += [ "tizen" ]
21+
}
1822
} else if (is_win) {
1923
deps = []
2024
if (enable_desktop_embeddings) {

shell/platform/common/cpp/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ source_set("common_cpp") {
6868
deps = [
6969
":common_cpp_library_headers",
7070
"//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper",
71-
"//flutter/shell/platform/embedder:embedder_as_internal_library",
71+
# "//flutter/shell/platform/embedder:embedder_as_internal_library",
7272
]
7373

7474
public_deps = [

shell/platform/linux/BUILD.gn

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,20 @@
55
assert(is_linux)
66

77
import("//flutter/shell/platform/glfw/config.gni")
8-
import("//flutter/shell/platform/tizen/config.gni")
98
import("//flutter/testing/testing.gni")
109

1110
group("linux") {
12-
deps = []
13-
11+
deps = [
12+
":flutter_linux_gtk",
13+
":publish_headers_linux",
14+
]
1415
if (build_glfw_shell) {
1516
deps += [
1617
":flutter_linux_glfw",
1718
"//flutter/shell/platform/glfw:publish_headers_glfw",
1819
"//flutter/shell/platform/glfw/client_wrapper:publish_wrapper_glfw",
1920
]
2021
}
21-
22-
if (build_tizen_shell) {
23-
deps += [
24-
":flutter_linux_tizen",
25-
"//flutter/shell/platform/tizen:publish_headers_tizen",
26-
]
27-
}
2822
}
2923

3024
# Temporary workaround for the issue describe in
@@ -47,16 +41,6 @@ if (build_glfw_shell) {
4741
}
4842
}
4943

50-
if (build_tizen_shell) {
51-
shared_library("flutter_linux_tizen") {
52-
deps = [ "//flutter/shell/platform/tizen:flutter_tizen" ]
53-
54-
configs += [ ":disable_fatal_link_warnings" ]
55-
56-
public_configs = [ "//flutter:config" ]
57-
}
58-
}
59-
6044
_public_headers = [
6145
"public/flutter_linux/fl_basic_message_channel.h",
6246
"public/flutter_linux/fl_binary_codec.h",
@@ -87,7 +71,7 @@ config("relative_flutter_linux_headers") {
8771
source_set("flutter_linux_sources") {
8872
public = _public_headers
8973

90-
# configs += [ "//flutter/shell/platform/linux/config:gtk" ]
74+
configs += [ "//flutter/shell/platform/linux/config:gtk" ]
9175

9276
sources = [
9377
"egl_utils.cc",
@@ -131,8 +115,8 @@ source_set("flutter_linux_sources") {
131115

132116
source_set("flutter_linux") {
133117
configs += [
134-
# "//flutter/shell/platform/linux/config:gtk",
135-
# "//flutter/shell/platform/linux/config:egl",
118+
"//flutter/shell/platform/linux/config:gtk",
119+
"//flutter/shell/platform/linux/config:egl",
136120
"//third_party/khronos:khronos_headers",
137121
]
138122

@@ -172,7 +156,7 @@ executable("flutter_linux_unittests") {
172156

173157
public_configs = [ "//flutter:config" ]
174158

175-
# configs += [ "//flutter/shell/platform/linux/config:gtk" ]
159+
configs += [ "//flutter/shell/platform/linux/config:gtk" ]
176160

177161
# Set flag to allow public headers to be directly included (library users should not do this)
178162
defines = [ "FLUTTER_LINUX_COMPILATION" ]

shell/platform/tizen/BUILD.gn

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@
44
# found in the LICENSE file.
55
import("//flutter/shell/platform/tizen/config.gni")
66

7-
_public_headers = [ "public/flutter_tizen.h" ]
8-
9-
# Any files that are built by clients (client_wrapper code, library headers for
10-
# implementations using this shared code, etc.) include the public headers
11-
# assuming they are in the include path. This configuration should be added to
12-
# any such code that is also built by GN to make the includes work.
13-
config("relative_flutter_tizen_headers") {
14-
include_dirs = [ "public" ]
7+
group("tizen") {
8+
deps = [ ":flutter_tizen_library" ]
9+
}
10+
11+
shared_library("flutter_tizen_library") {
12+
output_name = "flutter_tizen"
13+
14+
ldflags = [ "-Wl,-rpath,\$ORIGIN" ]
15+
16+
deps = [ ":flutter_tizen" ]
17+
18+
public_configs = [ "//flutter:config" ]
1519
}
1620

17-
# The headers are a separate source set since the client wrapper is allowed
18-
# to depend on the public headers, but none of the rest of the code.
1921
source_set("flutter_tizen_headers") {
20-
public = _public_headers
22+
public = [
23+
"public/flutter_platform_view.h",
24+
"public/flutter_texture_registrar.h",
25+
"public/flutter_tizen.h",
26+
]
2127

2228
public_deps =
2329
[ "//flutter/shell/platform/common/cpp:common_cpp_library_headers" ]
@@ -57,7 +63,7 @@ source_set("flutter_tizen") {
5763
"//flutter/shell/platform/common/cpp:common_cpp",
5864
"//flutter/shell/platform/common/cpp:common_cpp_input",
5965
"//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper",
60-
"//flutter/shell/platform/embedder:embedder_as_internal_library",
66+
"//flutter/shell/platform/embedder:flutter_engine",
6167
"//third_party/rapidjson",
6268
]
6369

@@ -83,7 +89,7 @@ source_set("flutter_tizen") {
8389
"$custom_sysroot/usr/include/wayland-extension"
8490
]
8591

86-
lib_dirs = [ "$custom_sysroot/usr/lib" ]
92+
lib_dirs = [ root_out_dir, "$custom_sysroot/usr/lib" ]
8793

8894
cflags_cc = [
8995
"-Wno-newline-eof",
@@ -101,6 +107,7 @@ source_set("flutter_tizen") {
101107
"ecore_input",
102108
"EGL",
103109
"evas",
110+
"flutter_engine",
104111
"GLESv2",
105112
"tbm",
106113
"tdm-client",
@@ -116,11 +123,3 @@ source_set("flutter_tizen") {
116123
libs += [ "ecore_wl2" ]
117124
}
118125
}
119-
120-
copy("publish_headers_tizen") {
121-
sources = _public_headers
122-
outputs = [ "$root_out_dir/{{source_file_part}}" ]
123-
124-
# The Tizen header assumes the presence of the common headers.
125-
deps = [ "//flutter/shell/platform/common/cpp:publish_headers" ]
126-
}

0 commit comments

Comments
 (0)