1# Copyright (c) 2024 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_common_native_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "include", 21 "${inputmethod_path}/frameworks/native/inputmethod_controller/include", 22 "${inputmethod_path}/frameworks/native/inputmethod_ability/include", 23 ] 24} 25 26ohos_shared_library("inputmethod_common") { 27 branch_protector_ret = "pac_ret" 28 sanitize = { 29 boundary_sanitize = true 30 cfi = true 31 cfi_cross_dso = true 32 debug = false 33 integer_overflow = true 34 ubsan = true 35 } 36 cflags_cc = [ 37 "-fdata-sections", 38 "-ffunction-sections", 39 "-Os", 40 ] 41 sources = [ 42 "src/global.cpp", 43 "src/input_death_recipient.cpp", 44 "src/inputmethod_dump.cpp", 45 "src/inputmethod_sysevent.cpp", 46 "src/inputmethod_trace.cpp", 47 "src/itypes_util.cpp", 48 "src/message.cpp", 49 "src/message_handler.cpp", 50 "src/on_demand_start_stop_sa.cpp", 51 "src/string_utils.cpp", 52 ] 53 54 if (imf_on_demand_start_stop_sa_enable) { 55 if (defined(defines)) { 56 defines += [ "IMF_ON_DEMAND_START_STOP_SA_ENABLE" ] 57 } else { 58 defines = [ "IMF_ON_DEMAND_START_STOP_SA_ENABLE" ] 59 } 60 } 61 62 configs = [ ":inputmethod_common_native_config" ] 63 64 deps = [ 65 "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_client_types", 66 "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub", 67 ] 68 69 public_configs = [ 70 ":inputmethod_common_native_config", 71 "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_native_public_config", 72 "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_native_public_config", 73 ] 74 75 external_deps = [ 76 "ability_base:want", 77 "c_utils:utils", 78 "hilog:libhilog", 79 "hisysevent:libhisysevent", 80 "hitrace:hitrace_meter", 81 "hitrace:libhitracechain", 82 "icu:shared_icuuc", 83 "input:libmmi-client", 84 "ipc:ipc_single", 85 "samgr:samgr_proxy", 86 ] 87 88 subsystem_name = "inputmethod" 89 part_name = "imf" 90} 91