1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/inputmethod/imf/inputmethod.gni")
15import("//build/ohos.gni")
16
17config("inputmethod_services_native_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "include",
21    "${inputmethod_path}/common/include",
22    "${inputmethod_path}/frameworks/common",
23    "${inputmethod_path}/frameworks/native/inputmethod_ability/include",
24    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
25    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability/include",
26    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
27    "${inputmethod_path}/services/adapter/focus_monitor/include",
28    "${inputmethod_path}/services/adapter/ime_connection_manager/include",
29    "${inputmethod_path}/services/adapter/keyboard/include",
30    "${inputmethod_path}/services/adapter/os_account_adapter/include",
31    "${inputmethod_path}/services/adapter/system_language_observer/include",
32    "${inputmethod_path}/services/adapter/wms_connection_monitor/include",
33    "${inputmethod_path}/services/identity_checker/include",
34  ]
35}
36
37ohos_shared_library("inputmethod_service") {
38  branch_protector_ret = "pac_ret"
39  sanitize = {
40    cfi = true
41    cfi_cross_dso = true
42    debug = false
43  }
44  cflags_cc = [
45    "-fexceptions",
46    "-fvisibility=hidden",
47    "-fvisibility-inlines-hidden",
48    "-fdata-sections",
49    "-ffunction-sections",
50    "-Os",
51    "-Wno-c99-designator",
52  ]
53  sources = [
54    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
55    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
56    "${inputmethod_path}/services/adapter/focus_monitor/src/focus_change_listener.cpp",
57    "${inputmethod_path}/services/adapter/focus_monitor/src/focus_monitor_manager.cpp",
58    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
59    "${inputmethod_path}/services/adapter/system_language_observer/src/system_language_observer.cpp",
60    "${inputmethod_path}/services/adapter/wms_connection_monitor/src/wms_connection_monitor_manager.cpp",
61    "${inputmethod_path}/services/adapter/wms_connection_monitor/src/wms_connection_observer.cpp",
62    "${inputmethod_path}/services/identity_checker/src/identity_checker_impl.cpp",
63    "adapter/os_account_adapter/src/os_account_adapter.cpp",
64    "src/freeze_manager.cpp",
65    "src/full_ime_info_manager.cpp",
66    "src/im_common_event_manager.cpp",
67    "src/ime_cfg_manager.cpp",
68    "src/ime_info_inquirer.cpp",
69    "src/input_control_channel_stub.cpp",
70    "src/input_method_system_ability.cpp",
71    "src/input_method_system_ability_stub.cpp",
72    "src/input_type_manager.cpp",
73    "src/peruser_session.cpp",
74    "src/sys_cfg_parser.cpp",
75    "src/user_session_manager.cpp",
76  ]
77
78  configs = [ ":inputmethod_services_native_config" ]
79
80  public_configs = [ ":inputmethod_services_native_config" ]
81
82  deps = [
83    "${inputmethod_path}/common:inputmethod_common",
84    "${inputmethod_path}/services/adapter/keyboard:keboard_event_static",
85    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
86    "${inputmethod_path}/services/file:imf_file_static",
87    "${inputmethod_path}/services/json:imf_json_static",
88    "//third_party/cJSON:cjson",
89  ]
90
91  external_deps = [
92    "ability_base:want",
93    "ability_runtime:ability_connect_callback_stub",
94    "ability_runtime:ability_manager",
95    "ability_runtime:app_manager",
96    "access_token:libaccesstoken_sdk",
97    "access_token:libtokenid_sdk",
98    "bundle_framework:appexecfwk_base",
99    "bundle_framework:appexecfwk_core",
100    "c_utils:utils",
101    "common_event_service:cesfwk_innerkits",
102    "config_policy:configpolicy_util",
103    "data_share:datashare_common",
104    "data_share:datashare_consumer",
105    "eventhandler:libeventhandler",
106    "hicollie:libhicollie",
107    "hilog:libhilog",
108    "i18n:intl_util",
109    "init:libbeget_proxy",
110    "init:libbegetutil",
111    "input:libmmi-client",
112    "ipc:ipc_single",
113    "memmgr:memmgrclient",
114    "os_account:os_account_innerkits",
115    "resource_management:global_resmgr",
116    "resource_schedule_service:ressched_client",
117    "safwk:system_ability_fwk",
118    "samgr:samgr_proxy",
119    "window_manager:libwsutils",
120  ]
121
122  defines = []
123  if (imf_screenlock_mgr_enable) {
124    defines += [ "IMF_SCREENLOCK_MGR_ENABLE" ]
125    external_deps += [ "screenlock_mgr:screenlock_client" ]
126  }
127  if (window_manager_use_sceneboard) {
128    external_deps += [ "window_manager:libwm_lite" ]
129    defines += [ "SCENE_BOARD_ENABLE" ]
130  } else {
131    external_deps += [ "window_manager:libwm" ]
132  }
133  subsystem_name = "inputmethod"
134  part_name = "imf"
135}
136
137ohos_static_library("inputmethod_service_static") {
138  branch_protector_ret = "pac_ret"
139  sanitize = {
140    cfi = true
141    cfi_cross_dso = true
142    debug = false
143  }
144  cflags_cc = [
145    "-fdata-sections",
146    "-ffunction-sections",
147    "-Os",
148  ]
149  sources = [
150    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
151    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
152    "adapter/focus_monitor/src/focus_change_listener.cpp",
153    "adapter/focus_monitor/src/focus_monitor_manager.cpp",
154    "adapter/ime_connection_manager/src/ime_connection.cpp",
155    "adapter/os_account_adapter/src/os_account_adapter.cpp",
156    "adapter/system_language_observer/src/system_language_observer.cpp",
157    "adapter/wms_connection_monitor/src/wms_connection_monitor_manager.cpp",
158    "adapter/wms_connection_monitor/src/wms_connection_observer.cpp",
159    "identity_checker/src/identity_checker_impl.cpp",
160    "src/freeze_manager.cpp",
161    "src/full_ime_info_manager.cpp",
162    "src/im_common_event_manager.cpp",
163    "src/ime_cfg_manager.cpp",
164    "src/ime_info_inquirer.cpp",
165    "src/input_control_channel_stub.cpp",
166    "src/input_method_system_ability.cpp",
167    "src/input_method_system_ability_stub.cpp",
168    "src/input_type_manager.cpp",
169    "src/peruser_session.cpp",
170    "src/sys_cfg_parser.cpp",
171    "src/user_session_manager.cpp",
172  ]
173
174  public_configs = [ ":inputmethod_services_native_config" ]
175
176  public_deps = [
177    "${inputmethod_path}/common:inputmethod_common",
178    "adapter/keyboard:keboard_event_static",
179    "adapter/settings_data_provider:settings_data_static",
180    "file:imf_file_static",
181    "json:imf_json_static",
182  ]
183
184  external_deps = [
185    "ability_base:want",
186    "ability_runtime:ability_manager",
187    "ability_runtime:app_manager",
188    "access_token:libaccesstoken_sdk",
189    "access_token:libtokenid_sdk",
190    "bundle_framework:appexecfwk_base",
191    "bundle_framework:appexecfwk_core",
192    "c_utils:utils",
193    "common_event_service:cesfwk_innerkits",
194    "config_policy:configpolicy_util",
195    "data_share:datashare_common",
196    "data_share:datashare_consumer",
197    "eventhandler:libeventhandler",
198    "hicollie:libhicollie",
199    "hilog:libhilog",
200    "i18n:intl_util",
201    "init:libbeget_proxy",
202    "init:libbegetutil",
203    "input:libmmi-client",
204    "ipc:ipc_single",
205    "memmgr:memmgrclient",
206    "os_account:os_account_innerkits",
207    "resource_management:global_resmgr",
208    "resource_schedule_service:ressched_client",
209    "safwk:system_ability_fwk",
210    "samgr:samgr_proxy",
211    "window_manager:libwsutils",
212  ]
213
214  defines = []
215  if (imf_screenlock_mgr_enable) {
216    defines += [ "IMF_SCREENLOCK_MGR_ENABLE" ]
217    external_deps += [ "screenlock_mgr:screenlock_client" ]
218  }
219  if (window_manager_use_sceneboard) {
220    external_deps += [ "window_manager:libwm_lite" ]
221    defines += [ "SCENE_BOARD_ENABLE" ]
222  } else {
223    external_deps += [ "window_manager:libwm" ]
224  }
225  subsystem_name = "inputmethod"
226  part_name = "imf"
227}
228