1# Copyright (c) 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("//build/config/components/idl_tool/idl.gni") 15import("//build/ohos.gni") 16 17idl_gen_interface("i18n_service_interface") { 18 src_idl = rebase_path("II18nServiceAbility.idl") 19 log_domainid = "0xD001E00" 20 log_tag = "GLOBAL_I18N" 21} 22 23group("i18n_service_ability") { 24 deps = [ 25 ":i18n_sa", 26 ":i18n_sa_client", 27 "./etc:i18n_sa_etc", 28 ] 29} 30 31config("I18n_service_public_config") { 32 include_dirs = [ 33 "${target_gen_dir}", 34 "./include", 35 "../frameworks/intl/include", 36 ] 37} 38 39ohos_shared_library("i18n_sa_client") { 40 sanitize = { 41 cfi = true 42 cfi_cross_dso = true 43 debug = false 44 } 45 branch_protector_ret = "pac_ret" 46 47 sources = [ 48 "./src/i18n_service_ability_client.cpp", 49 "./src/i18n_service_ability_load_callback.cpp", 50 "./src/i18n_service_ability_load_manager.cpp", 51 ] 52 output_values = get_target_outputs(":i18n_service_interface") 53 sources += filter_include(output_values, [ "*_proxy.cpp" ]) 54 public_configs = [ ":I18n_service_public_config" ] 55 deps = [ ":i18n_service_interface" ] 56 external_deps = [ 57 "c_utils:utils", 58 "hilog:libhilog", 59 "ipc:ipc_core", 60 "samgr:samgr_proxy", 61 ] 62 if (target_platform == "watch") { 63 defines = [ "DEVICE_WATCH" ] 64 } 65 innerapi_tags = [ "platformsdk" ] 66 part_name = "i18n" 67 subsystem_name = "global" 68} 69 70ohos_shared_library("i18n_sa") { 71 sanitize = { 72 cfi = true 73 cfi_cross_dso = true 74 debug = false 75 } 76 branch_protector_ret = "pac_ret" 77 78 sources = [ 79 "./src/i18n_service_ability.cpp", 80 "./src/i18n_service_event.cpp", 81 ] 82 output_values = get_target_outputs(":i18n_service_interface") 83 sources += filter_include(output_values, [ "*_stub.cpp" ]) 84 include_dirs = [ 85 "${target_gen_dir}", 86 "./include", 87 "../frameworks/intl/include", 88 "../interfaces/native/inner_api/preferred_language/include", 89 ] 90 deps = [ 91 ":i18n_sa_client", 92 ":i18n_service_interface", 93 "../frameworks/intl:intl_util", 94 "../frameworks/intl:preferred_language", 95 ] 96 if (target_platform == "pc") { 97 defines = [ "SUPPORT_MULTI_USER" ] 98 } 99 external_deps = [ 100 "ability_base:want", 101 "ability_runtime:ability_manager", 102 "access_token:libaccesstoken_sdk", 103 "access_token:libtokenid_sdk", 104 "c_utils:utils", 105 "eventhandler:libeventhandler", 106 "hilog:libhilog", 107 "ipc:ipc_core", 108 "memmgr:memmgrclient", 109 "openssl:libcrypto_shared", 110 "openssl:libssl_shared", 111 "os_account:os_account_innerkits", 112 "preferences:native_preferences", 113 "safwk:system_ability_fwk", 114 "samgr:samgr_proxy", 115 ] 116 part_name = "i18n" 117 subsystem_name = "global" 118} 119