1# Copyright (C) 2022 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("inputmethodengine_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_controller/include",
26  ]
27  ldflags = [ "-Wl,--exclude-libs=ALL" ]
28  cflags_cc = [
29    "-fvisibility=hidden",
30    "-fvisibility-inlines-hidden",
31    "-fdata-sections",
32    "-ffunction-sections",
33    "-Os",
34  ]
35}
36
37config("inputmethodengine_native_public_config") {
38  visibility = [ "./*" ]
39  include_dirs = [
40    "include",
41    "${inputmethod_path}/common/include",
42    "${inputmethod_path}/frameworks/common",
43    "${inputmethod_path}/frameworks/js/napi/inputmethodclient",
44    "${inputmethod_path}/frameworks/js/napi/inputmethodability",
45  ]
46}
47
48ohos_shared_library("inputmethodengine") {
49  branch_protector_ret = "pac_ret"
50  sanitize = {
51    cfi = true
52    cfi_cross_dso = true
53    debug = false
54  }
55  sources = [
56    "${inputmethod_path}/frameworks/js/napi/inputmethodclient/async_call.cpp",
57    "${inputmethod_path}/frameworks/js/napi/inputmethodclient/js_utils.cpp",
58    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_proxy.cpp",
59    "input_method_engine_module.cpp",
60    "js_input_method_engine_setting.cpp",
61    "js_keyboard_controller_engine.cpp",
62    "js_keyboard_delegate_setting.cpp",
63    "js_panel.cpp",
64    "js_text_input_client_engine.cpp",
65    "panel_listener_impl.cpp",
66  ]
67
68  configs = [ ":inputmethodengine_native_config" ]
69
70  deps = [
71    "${inputmethod_path}/common:inputmethod_common",
72    "${inputmethod_path}/frameworks/js/napi/common:inputmethod_js_common",
73    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
74    "${inputmethod_path}/services/json:imf_json_static",
75  ]
76
77  external_deps = [
78    "ability_base:configuration",
79    "ability_runtime:ability_context_native",
80    "ability_runtime:abilitykit_native",
81    "ability_runtime:napi_base_context",
82    "c_utils:utils",
83    "eventhandler:libeventhandler",
84    "ffrt:libffrt",
85    "hilog:libhilog",
86    "input:libmmi-client",
87    "input:libmmi-napi",
88    "ipc:ipc_core",
89    "napi:ace_napi",
90    "window_manager:libwm_lite",
91  ]
92
93  public_configs = [ ":inputmethodengine_native_public_config" ]
94
95  relative_install_dir = "module"
96  subsystem_name = "inputmethod"
97  part_name = "imf"
98}
99