1# Copyright (c) 2022-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("ability_config") {
18  visibility = [ ":*" ]
19
20  cflags = []
21  if (target_cpu == "arm") {
22    cflags += [ "-DBINDER_IPC_32BIT" ]
23  }
24  defines = [
25    "APP_LOG_TAG = \"Ability\"",
26    "LOG_DOMAIN = 0xD002200",
27  ]
28}
29
30config("ability_public_config") {
31  visibility = [ ":*" ]
32  include_dirs = [ "${inputmethod_path}/frameworks/kits/extension/include" ]
33}
34
35ohos_shared_library("inputmethod_extension") {
36  branch_protector_ret = "pac_ret"
37  sanitize = {
38    cfi = true
39    cfi_cross_dso = true
40    debug = false
41  }
42  cflags_cc = [
43    "-fdata-sections",
44    "-ffunction-sections",
45    "-Os",
46  ]
47  include_dirs = [
48    "${inputmethod_path}/frameworks/js/napi/common",
49    "${inputmethod_path}/frameworks/js/napi/inputmethodclient",
50    "${inputmethod_path}/frameworks/kits/extension/include",
51    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
52    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
53    "${inputmethod_path}/common/include",
54  ]
55
56  sources = [
57    "${inputmethod_path}/frameworks/js/napi/inputmethodclient/js_utils.cpp",
58    "${inputmethod_path}/frameworks/kits/extension/src/inputmethod_extension.cpp",
59    "${inputmethod_path}/frameworks/kits/extension/src/inputmethod_extension_context.cpp",
60    "${inputmethod_path}/frameworks/kits/extension/src/js_inputmethod_extension.cpp",
61    "${inputmethod_path}/frameworks/kits/extension/src/js_inputmethod_extension_context.cpp",
62  ]
63  configs = [ ":ability_config" ]
64  public_configs = [ ":ability_public_config" ]
65
66  deps = [
67    "${inputmethod_path}/common:inputmethod_common",
68    "${inputmethod_path}/frameworks/js/napi/common:inputmethod_js_common",
69    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
70  ]
71
72  external_deps = [
73    "ability_base:configuration",
74    "ability_base:want",
75    "ability_runtime:ability_context_native",
76    "ability_runtime:ability_manager",
77    "ability_runtime:ability_start_options",
78    "ability_runtime:abilitykit_native",
79    "ability_runtime:app_context",
80    "ability_runtime:napi_common",
81    "ability_runtime:runtime",
82    "c_utils:utils",
83    "eventhandler:libeventhandler",
84    "hilog:libhilog",
85    "i18n:intl_util",
86    "input:libmmi-client",
87    "ipc:ipc_napi",
88    "ipc:ipc_single",
89    "napi:ace_napi",
90    "samgr:samgr_proxy",
91    "window_manager:libdm",
92  ]
93
94  subsystem_name = "inputmethod"
95  part_name = "imf"
96}
97
98ohos_shared_library("inputmethod_extension_module") {
99  branch_protector_ret = "pac_ret"
100  sanitize = {
101    cfi = true
102    cfi_cross_dso = true
103    debug = false
104  }
105  include_dirs = [ "${inputmethod_path}/common/include" ]
106
107  sources = [ "${inputmethod_path}/frameworks/kits/extension/src/inputmethod_extension_module_loader.cpp" ]
108
109  configs = [ ":ability_config" ]
110  public_configs = [ ":ability_public_config" ]
111
112  deps = [ ":inputmethod_extension" ]
113
114  external_deps = [
115    "ability_base:base",
116    "ability_base:want",
117    "ability_base:zuri",
118    "ability_runtime:abilitykit_native",
119    "ability_runtime:runtime",
120    "c_utils:utils",
121    "hilog:libhilog",
122    "napi:ace_napi",
123  ]
124
125  relative_install_dir = "extensionability/"
126  subsystem_name = "inputmethod"
127  part_name = "imf"
128}
129