Skip to content

Commit ccb8911

Browse files
authored
Unsupport the Linux x64 build (#248)
* Remove x64-specific files and organize BUILD.gn * Remove obsolete Linux-specific code * Rename external_texture_surface_gl.cc and system_utils.cc * Simplify GetExecutableDirectory * Clean up
1 parent fb20304 commit ccb8911

17 files changed

+65
-305
lines changed

shell/platform/tizen/BUILD.gn

Lines changed: 55 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -34,58 +34,44 @@ _public_headers = [
3434
# added to the compiler's search paths. Since we are not using the Tizen CLI
3535
# builder, we have to add them manually.
3636
config("rootstrap_include_dirs") {
37-
local_prefix = "$custom_sysroot/usr"
38-
39-
if (!embedder_for_target && target_cpu == "x64") {
40-
defines = [ "__X64_SHELL__" ]
41-
42-
local_prefix += "/local"
43-
}
44-
4537
include_dirs = [
46-
"$local_prefix/include",
47-
"$local_prefix/include/appfw",
48-
"$local_prefix/include/base",
49-
"$local_prefix/include/dlog",
50-
"$local_prefix/include/ecore-1",
51-
"$local_prefix/include/ecore-imf-1",
52-
"$local_prefix/include/ecore-input-1",
53-
"$local_prefix/include/ecore-wayland-1",
54-
"$local_prefix/include/ecore-wl2-1",
55-
"$local_prefix/include/efl-1",
56-
"$local_prefix/include/efl-extension",
57-
"$local_prefix/include/eina-1",
58-
"$local_prefix/include/eina-1/eina",
59-
"$local_prefix/include/emile-1",
60-
"$local_prefix/include/eo-1",
61-
"$local_prefix/include/feedback",
62-
"$local_prefix/include/system",
63-
"$local_prefix/include/tzsh",
64-
"$local_prefix/include/wayland-extension",
38+
"$custom_sysroot/usr/include",
39+
"$custom_sysroot/usr/include/appfw",
40+
"$custom_sysroot/usr/include/base",
41+
"$custom_sysroot/usr/include/dlog",
42+
"$custom_sysroot/usr/include/ecore-1",
43+
"$custom_sysroot/usr/include/ecore-imf-1",
44+
"$custom_sysroot/usr/include/ecore-input-1",
45+
"$custom_sysroot/usr/include/ecore-wayland-1",
46+
"$custom_sysroot/usr/include/ecore-wl2-1",
47+
"$custom_sysroot/usr/include/efl-1",
48+
"$custom_sysroot/usr/include/efl-extension",
49+
"$custom_sysroot/usr/include/eina-1",
50+
"$custom_sysroot/usr/include/eina-1/eina",
51+
"$custom_sysroot/usr/include/emile-1",
52+
"$custom_sysroot/usr/include/eo-1",
53+
"$custom_sysroot/usr/include/feedback",
54+
"$custom_sysroot/usr/include/system",
55+
"$custom_sysroot/usr/include/tzsh",
56+
"$custom_sysroot/usr/include/wayland-extension",
6557
]
6658

6759
# Contain headers that the Evas_GL renderer depends on.
6860
include_dirs += [
69-
"$local_prefix/include/ecore-con-1",
70-
"$local_prefix/include/ecore-evas-1",
71-
"$local_prefix/include/ecore-file-1",
72-
"$local_prefix/include/edje-1",
73-
"$local_prefix/include/eet-1",
74-
"$local_prefix/include/efl-1/interfaces",
75-
"$local_prefix/include/efreet-1",
76-
"$local_prefix/include/elementary-1",
77-
"$local_prefix/include/ethumb-1",
78-
"$local_prefix/include/ethumb-client-1",
79-
"$local_prefix/include/evas-1",
61+
"$custom_sysroot/usr/include/ecore-con-1",
62+
"$custom_sysroot/usr/include/ecore-evas-1",
63+
"$custom_sysroot/usr/include/ecore-file-1",
64+
"$custom_sysroot/usr/include/edje-1",
65+
"$custom_sysroot/usr/include/eet-1",
66+
"$custom_sysroot/usr/include/efl-1/interfaces",
67+
"$custom_sysroot/usr/include/efreet-1",
68+
"$custom_sysroot/usr/include/elementary-1",
69+
"$custom_sysroot/usr/include/ethumb-1",
70+
"$custom_sysroot/usr/include/ethumb-client-1",
71+
"$custom_sysroot/usr/include/evas-1",
8072
]
8173

82-
if (!embedder_for_target && target_cpu == "x64") {
83-
include_dirs += [ "$local_prefix/include/eldbus-1" ]
84-
85-
lib_dirs = [ "$local_prefix/lib/x86_64-linux-gnu" ]
86-
} else {
87-
lib_dirs = [ "$local_prefix/lib" ]
88-
}
74+
lib_dirs = [ "$custom_sysroot/usr/lib" ]
8975

9076
cflags_cc = [
9177
"-Wno-newline-eof",
@@ -114,32 +100,56 @@ template("embedder") {
114100
public = _public_headers
115101

116102
sources = [
103+
"channels/app_control.cc",
104+
"channels/app_control_channel.cc",
117105
"channels/key_event_channel.cc",
118106
"channels/lifecycle_channel.cc",
119107
"channels/navigation_channel.cc",
120108
"channels/platform_channel.cc",
109+
"channels/platform_channel_tizen.cc",
121110
"channels/platform_view_channel.cc",
122111
"channels/settings_channel.cc",
112+
"channels/settings_channel_tizen.cc",
123113
"channels/text_input_channel.cc",
114+
"channels/window_channel.cc",
124115
"external_texture_pixel_gl.cc",
116+
"external_texture_surface_gl.cc",
125117
"flutter_project_bundle.cc",
126118
"flutter_tizen.cc",
127119
"flutter_tizen_engine.cc",
128120
"flutter_tizen_texture_registrar.cc",
129121
"key_event_handler.cc",
130122
"logger.cc",
123+
"system_utils.cc",
131124
"tizen_event_loop.cc",
132125
"tizen_input_method_context.cc",
133126
"tizen_renderer.cc",
134127
"touch_event_handler.cc",
135128
]
136129

137130
libs = [
131+
"base-utils-i18n",
132+
"capi-appfw-application",
133+
"capi-appfw-app-common",
134+
"capi-appfw-app-control",
135+
"capi-base-common",
136+
"capi-system-info",
137+
"capi-system-system-settings",
138+
"capi-ui-efl-util",
139+
"dlog",
138140
"ecore",
139141
"ecore_imf",
140142
"ecore_input",
143+
"efl-extension",
141144
"eina",
145+
"feedback",
146+
"tbm",
147+
"tdm-client",
148+
"tzsh_common",
149+
"tzsh_softkey",
142150
"wayland-client",
151+
"EGL",
152+
"GLESv2",
143153
]
144154

145155
defines += invoker.defines
@@ -153,45 +163,6 @@ template("embedder") {
153163
"//flutter:config",
154164
]
155165

156-
if (embedder_for_target) {
157-
sources += [
158-
"channels/app_control.cc",
159-
"channels/app_control_channel.cc",
160-
"channels/platform_channel_tizen.cc",
161-
"channels/settings_channel_tizen.cc",
162-
"channels/window_channel.cc",
163-
"external_texture_surface_gl_tizen.cc",
164-
"system_utils_tizen.cc",
165-
]
166-
167-
libs += [
168-
"base-utils-i18n",
169-
"capi-appfw-application",
170-
"capi-appfw-app-common",
171-
"capi-appfw-app-control",
172-
"capi-base-common",
173-
"capi-system-info",
174-
"capi-system-system-settings",
175-
"capi-ui-efl-util",
176-
"dlog",
177-
"efl-extension",
178-
"feedback",
179-
"tbm",
180-
"tdm-client",
181-
"tzsh_common",
182-
"tzsh_softkey",
183-
"EGL",
184-
"GLESv2",
185-
]
186-
} else {
187-
sources += [
188-
"channels/platform_channel_linux.cc",
189-
"channels/settings_channel_linux.cc",
190-
"external_texture_surface_gl_linux.cc",
191-
"system_utils_linux.cc",
192-
]
193-
}
194-
195166
if (use_evas_gl_renderer) {
196167
sources += [ "tizen_renderer_evas_gl.cc" ]
197168

shell/platform/tizen/channels/platform_channel_linux.cc

Lines changed: 0 additions & 39 deletions
This file was deleted.

shell/platform/tizen/channels/settings_channel_linux.cc

Lines changed: 0 additions & 17 deletions
This file was deleted.

shell/platform/tizen/channels/text_input_channel.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,7 @@ void TextInputChannel::SendStateUpdate(const TextInputModel& model) {
317317
bool TextInputChannel::FilterEvent(Ecore_Event_Key* event, bool is_down) {
318318
bool handled = false;
319319

320-
#if defined(__X64_SHELL__)
321-
bool is_ime = false;
322-
#elif defined(WEARABLE_PROFILE)
320+
#ifdef WEARABLE_PROFILE
323321
// Hardware keyboard is not supported on watch devices.
324322
bool is_ime = true;
325323
// FIXME: Only for wearable.

shell/platform/tizen/external_texture_surface_gl_linux.cc

Lines changed: 0 additions & 40 deletions
This file was deleted.

shell/platform/tizen/flutter_project_bundle.cc

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,32 @@
55

66
#include "flutter_project_bundle.h"
77

8-
#ifdef __X64_SHELL__
9-
#include "flutter/shell/platform/common/path_utils.h"
10-
#else
118
#include <app_common.h>
129
#include <linux/limits.h>
1310
#include <unistd.h>
14-
#endif
1511

1612
#include <filesystem>
1713

14+
#include "flutter/shell/platform/common/path_utils.h"
1815
#include "flutter/shell/platform/tizen/logger.h"
1916

2017
namespace flutter {
2118

22-
#ifndef __X64_SHELL__
2319
namespace {
2420

2521
// Returns the path of the directory containing the app binary, or an empty
2622
// string if the directory cannot be found.
27-
std::filesystem::path GetExecutableDirectory() {
23+
std::filesystem::path GetBinDirectory() {
2824
auto* res_path = app_get_resource_path();
2925
if (!res_path) {
30-
char buffer[PATH_MAX + 1];
31-
auto length = readlink("/proc/self/exe", buffer, sizeof(buffer));
32-
if (length > PATH_MAX) {
33-
return std::filesystem::path();
34-
}
35-
std::filesystem::path executable_path(std::string(buffer, length));
36-
return executable_path.remove_filename();
26+
return GetExecutableDirectory();
3727
}
3828
auto bin_path = std::filesystem::path(res_path) / ".." / "bin";
3929
free(res_path);
4030
return bin_path.lexically_normal();
4131
}
4232

4333
} // namespace
44-
#endif
4534

4635
FlutterProjectBundle::FlutterProjectBundle(
4736
const FlutterDesktopEngineProperties& properties)
@@ -59,7 +48,7 @@ FlutterProjectBundle::FlutterProjectBundle(
5948
// Resolve any relative paths.
6049
if (assets_path_.is_relative() || icu_path_.is_relative() ||
6150
(!aot_library_path_.empty() && aot_library_path_.is_relative())) {
62-
std::filesystem::path executable_location = GetExecutableDirectory();
51+
std::filesystem::path executable_location = GetBinDirectory();
6352
if (executable_location.empty()) {
6453
FT_LOG(Error)
6554
<< "Unable to find executable location to resolve resource paths.";

shell/platform/tizen/flutter_tizen.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ FlutterDesktopEngineRef FlutterDesktopRunEngine(
4646
if (project.HasArgument("--verbose-logging")) {
4747
flutter::Logger::SetLoggingLevel(flutter::kLogLevelDebug);
4848
}
49-
#ifndef __X64_SHELL__
5049
std::string logging_port;
5150
if (project.GetArgumentValue("--tizen-logging-port", &logging_port)) {
5251
flutter::Logger::SetLoggingPort(std::stoi(logging_port));
5352
}
5453
flutter::Logger::Start();
55-
#endif
5654

5755
auto engine = std::make_unique<flutter::FlutterTizenEngine>(project);
5856
if (window_properties.headed) {
@@ -69,10 +67,9 @@ FlutterDesktopEngineRef FlutterDesktopRunEngine(
6967
}
7068

7169
void FlutterDesktopShutdownEngine(FlutterDesktopEngineRef engine_ref) {
72-
#ifndef __X64_SHELL__
7370
flutter::Logger::Stop();
74-
#endif
75-
auto engine = EngineFromHandle(engine_ref);
71+
72+
auto* engine = EngineFromHandle(engine_ref);
7673
engine->StopEngine();
7774
delete engine;
7875
}
@@ -149,10 +146,8 @@ void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger,
149146

150147
void FlutterDesktopNotifyAppControl(FlutterDesktopEngineRef engine,
151148
void* app_control) {
152-
#ifndef __X64_SHELL__
153149
EngineFromHandle(engine)->app_control_channel()->NotifyAppControl(
154150
app_control);
155-
#endif
156151
}
157152

158153
void FlutterDesktopNotifyLocaleChange(FlutterDesktopEngineRef engine) {

0 commit comments

Comments
 (0)