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 boundary_sanitize = true 52 cfi = true 53 cfi_cross_dso = true 54 debug = false 55 integer_overflow = true 56 ubsan = true 57 } 58 sources = [ 59 "${inputmethod_path}/frameworks/js/napi/inputmethodclient/async_call.cpp", 60 "${inputmethod_path}/frameworks/js/napi/inputmethodclient/js_utils.cpp", 61 "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp", 62 "input_method_engine_module.cpp", 63 "js_input_method_engine_setting.cpp", 64 "js_keyboard_controller_engine.cpp", 65 "js_keyboard_delegate_setting.cpp", 66 "js_panel.cpp", 67 "js_text_input_client_engine.cpp", 68 "panel_listener_impl.cpp", 69 ] 70 71 configs = [ ":inputmethodengine_native_config" ] 72 73 deps = [ 74 "${inputmethod_path}/common:inputmethod_common", 75 "${inputmethod_path}/frameworks/js/napi/common:inputmethod_js_common", 76 "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy", 77 "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability", 78 "${inputmethod_path}/services/json:imf_json_static", 79 ] 80 81 external_deps = [ 82 "ability_base:configuration", 83 "ability_runtime:ability_context_native", 84 "ability_runtime:abilitykit_native", 85 "ability_runtime:extensionkit_native", 86 "ability_runtime:napi_base_context", 87 "c_utils:utils", 88 "eventhandler:libeventhandler", 89 "ffrt:libffrt", 90 "hilog:libhilog", 91 "input:libmmi-client", 92 "input:libmmi-napi", 93 "ipc:ipc_core", 94 "ipc:ipc_single", 95 "napi:ace_napi", 96 "window_manager:libwm_lite", 97 "resource_management:global_resmgr", 98 "ability_runtime:app_context", 99 ] 100 101 public_configs = [ ":inputmethodengine_native_public_config" ] 102 103 defines = [] 104 if (window_manager_use_sceneboard) { 105 defines += [ "SCENE_BOARD_ENABLE" ] 106 } 107 108 relative_install_dir = "module" 109 subsystem_name = "inputmethod" 110 part_name = "imf" 111} 112