1# Copyright (c) 2021-2023 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_client_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_controller/include",
24    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
25    "${inputmethod_path}/services/include",
26  ]
27}
28
29config("inputmethod_client_native_public_config") {
30  visibility = [ "./*" ]
31  include_dirs = [
32    "include",
33    "${inputmethod_path}/common/include",
34    "${inputmethod_path}/frameworks/common",
35    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
36    "${inputmethod_path}/frameworks/native/inputmethod_ability/include",
37    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability/include",
38    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
39    "${inputmethod_path}/services/include",
40  ]
41}
42
43ohos_shared_library("inputmethod_client") {
44  branch_protector_ret = "pac_ret"
45  sanitize = {
46    cfi = true
47    cfi_cross_dso = true
48    debug = false
49  }
50  sources = [
51    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_proxy.cpp",
52    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager.cpp",
53    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager_impl.cpp",
54    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_system_channel.cpp",
55    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_stub.cpp",
56    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_stub.cpp",
57    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_controller.cpp",
58    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_system_ability_proxy.cpp",
59    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp",
60    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_stub.cpp",
61    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/system_cmd_channel_stub.cpp",
62  ]
63
64  cflags_cc = [
65    "-fvisibility=hidden",
66    "-fvisibility-inlines-hidden",
67    "-fdata-sections",
68    "-ffunction-sections",
69    "-Os",
70    "-Wno-c99-designator",
71  ]
72
73  version_script = "inputmethod_client.versionscript"
74
75  innerapi_tags = [ "platformsdk" ]
76
77  deps = [ "${inputmethod_path}/common:inputmethod_common" ]
78
79  external_deps = [
80    "ability_base:want",
81    "bundle_framework:appexecfwk_base",
82    "bundle_framework:appexecfwk_core",
83    "c_utils:utils",
84    "eventhandler:libeventhandler",
85    "hilog:libhilog",
86    "input:libmmi-client",
87    "ipc:ipc_single",
88    "samgr:samgr_proxy",
89  ]
90
91  configs = [ ":inputmethod_client_native_config" ]
92
93  public_configs = [ ":inputmethod_client_native_public_config" ]
94
95  subsystem_name = "inputmethod"
96  part_name = "imf"
97}
98
99ohos_static_library("inputmethod_client_static") {
100  testonly = true
101  branch_protector_ret = "pac_ret"
102  sanitize = {
103    cfi = true
104    cfi_cross_dso = true
105    debug = false
106  }
107  sources = [
108    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_proxy.cpp",
109    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager.cpp",
110    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_event_monitor_manager_impl.cpp",
111    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/ime_system_channel.cpp",
112    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_stub.cpp",
113    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_stub.cpp",
114    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_controller.cpp",
115    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_system_ability_proxy.cpp",
116    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp",
117    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_stub.cpp",
118    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/system_cmd_channel_stub.cpp",
119  ]
120
121  public_configs = [ ":inputmethod_client_native_public_config" ]
122
123  deps = [ "${inputmethod_path}/common:inputmethod_common" ]
124
125  external_deps = [
126    "ability_base:want",
127    "bundle_framework:appexecfwk_base",
128    "bundle_framework:appexecfwk_core",
129    "c_utils:utils",
130    "eventhandler:libeventhandler",
131    "hilog:libhilog",
132    "input:libmmi-client",
133    "ipc:ipc_single",
134    "samgr:samgr_proxy",
135  ]
136
137  subsystem_name = "inputmethod"
138  part_name = "imf"
139}
140