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_manager",
94    "ability_runtime:app_manager",
95    "access_token:libaccesstoken_sdk",
96    "access_token:libtokenid_sdk",
97    "bundle_framework:appexecfwk_base",
98    "bundle_framework:appexecfwk_core",
99    "c_utils:utils",
100    "common_event_service:cesfwk_innerkits",
101    "config_policy:configpolicy_util",
102    "data_share:datashare_common",
103    "data_share:datashare_consumer",
104    "eventhandler:libeventhandler",
105    "hicollie:libhicollie",
106    "hilog:libhilog",
107    "i18n:intl_util",
108    "init:libbeget_proxy",
109    "init:libbegetutil",
110    "input:libmmi-client",
111    "ipc:ipc_single",
112    "memmgr:memmgrclient",
113    "os_account:os_account_innerkits",
114    "resource_management:global_resmgr",
115    "resource_schedule_service:ressched_client",
116    "safwk:system_ability_fwk",
117    "samgr:samgr_proxy",
118    "window_manager:libwsutils",
119  ]
120
121  defines = []
122  if (imf_screenlock_mgr_enable) {
123    defines += [ "IMF_SCREENLOCK_MGR_ENABLE" ]
124    external_deps += [ "screenlock_mgr:screenlock_client" ]
125  }
126  if (window_manager_use_sceneboard) {
127    external_deps += [ "window_manager:libwm_lite" ]
128    defines += [ "SCENE_BOARD_ENABLE" ]
129  } else {
130    external_deps += [ "window_manager:libwm" ]
131  }
132  subsystem_name = "inputmethod"
133  part_name = "imf"
134}
135
136ohos_static_library("inputmethod_service_static") {
137  branch_protector_ret = "pac_ret"
138  sanitize = {
139    cfi = true
140    cfi_cross_dso = true
141    debug = false
142  }
143  cflags_cc = [
144    "-fdata-sections",
145    "-ffunction-sections",
146    "-Os",
147  ]
148  sources = [
149    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
150    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_proxy.cpp",
151    "adapter/focus_monitor/src/focus_change_listener.cpp",
152    "adapter/focus_monitor/src/focus_monitor_manager.cpp",
153    "adapter/ime_connection_manager/src/ime_connection.cpp",
154    "adapter/os_account_adapter/src/os_account_adapter.cpp",
155    "adapter/system_language_observer/src/system_language_observer.cpp",
156    "adapter/wms_connection_monitor/src/wms_connection_monitor_manager.cpp",
157    "adapter/wms_connection_monitor/src/wms_connection_observer.cpp",
158    "identity_checker/src/identity_checker_impl.cpp",
159    "src/freeze_manager.cpp",
160    "src/full_ime_info_manager.cpp",
161    "src/im_common_event_manager.cpp",
162    "src/ime_cfg_manager.cpp",
163    "src/ime_info_inquirer.cpp",
164    "src/input_control_channel_stub.cpp",
165    "src/input_method_system_ability.cpp",
166    "src/input_method_system_ability_stub.cpp",
167    "src/input_type_manager.cpp",
168    "src/peruser_session.cpp",
169    "src/sys_cfg_parser.cpp",
170    "src/user_session_manager.cpp",
171  ]
172
173  public_configs = [ ":inputmethod_services_native_config" ]
174
175  public_deps = [
176    "${inputmethod_path}/common:inputmethod_common",
177    "adapter/keyboard:keboard_event_static",
178    "adapter/settings_data_provider:settings_data_static",
179    "file:imf_file_static",
180    "json:imf_json_static",
181  ]
182
183  external_deps = [
184    "ability_base:want",
185    "ability_runtime:ability_manager",
186    "ability_runtime:app_manager",
187    "access_token:libaccesstoken_sdk",
188    "access_token:libtokenid_sdk",
189    "bundle_framework:appexecfwk_base",
190    "bundle_framework:appexecfwk_core",
191    "c_utils:utils",
192    "common_event_service:cesfwk_innerkits",
193    "config_policy:configpolicy_util",
194    "data_share:datashare_common",
195    "data_share:datashare_consumer",
196    "eventhandler:libeventhandler",
197    "hicollie:libhicollie",
198    "hilog:libhilog",
199    "i18n:intl_util",
200    "init:libbeget_proxy",
201    "init:libbegetutil",
202    "input:libmmi-client",
203    "ipc:ipc_single",
204    "memmgr:memmgrclient",
205    "os_account:os_account_innerkits",
206    "resource_management:global_resmgr",
207    "resource_schedule_service:ressched_client",
208    "safwk:system_ability_fwk",
209    "samgr:samgr_proxy",
210    "window_manager:libwsutils",
211  ]
212
213  defines = []
214  if (imf_screenlock_mgr_enable) {
215    defines += [ "IMF_SCREENLOCK_MGR_ENABLE" ]
216    external_deps += [ "screenlock_mgr:screenlock_client" ]
217  }
218  if (window_manager_use_sceneboard) {
219    external_deps += [ "window_manager:libwm_lite" ]
220    defines += [ "SCENE_BOARD_ENABLE" ]
221  } else {
222    external_deps += [ "window_manager:libwm" ]
223  }
224  subsystem_name = "inputmethod"
225  part_name = "imf"
226}
227