1# Copyright (C) 2021 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. 13SUBSYSTEM_DIR = "../.." 14import("//build/ohos.gni") 15import("$SUBSYSTEM_DIR/core_service/telephony_core_service.gni") 16 17group("common_target") { 18 deps = [ ":libtel_common" ] 19} 20 21config("telephony_codec_config") { 22 include_dirs = [ "codec/include" ] 23} 24 25config("telephony_log_config") { 26 include_dirs = [ "log/include" ] 27} 28 29config("tel_napi_config") { 30 include_dirs = [ 31 "../frameworks/js/napi/", 32 "../frameworks/js/network_search/include/", 33 "../interfaces/innerkits/include/", 34 ] 35} 36 37config("tel_utils_config") { 38 include_dirs = [ 39 "common/include", 40 "preferences/include", 41 "log/include", 42 ] 43} 44 45config("tel_contact_config") { 46 include_dirs = [ 47 "vcard/include", 48 "vcard/include/contact_data", 49 ] 50} 51 52ohos_shared_library("libtel_common") { 53 sanitize = { 54 cfi = true 55 cfi_cross_dso = true 56 debug = false 57 } 58 branch_protector_ret = "pac_ret" 59 if (core_service_support_esim) { 60 version_script = "libtel_common_esim.versionscript" 61 } else { 62 version_script = "libtel_common.versionscript" 63 } 64 65 sources = [ 66 "../frameworks/js/napi/napi_util.cpp", 67 "common/src/base64.cpp", 68 "common/src/enum_convert.cpp", 69 "common/src/str_convert.cpp", 70 "common/src/tel_aes_crypto_util.cpp", 71 "common/src/tel_event_handler.cpp", 72 "common/src/tel_event_queue.cpp", 73 "common/src/telephony_common_utils.cpp", 74 "common/src/telephony_config.cpp", 75 "common/src/telephony_ext_utils_wrapper.cpp", 76 "common/src/telephony_permission.cpp", 77 "preferences/src/tel_profile_util.cpp", 78 ] 79 80 if (core_service_support_esim) { 81 sources += [ 82 "codec/src/asn1_builder.cpp", 83 "codec/src/asn1_decoder.cpp", 84 "codec/src/asn1_node.cpp", 85 "codec/src/asn1_utils.cpp", 86 "codec/src/request_apdu_build.cpp", 87 "codec/src/reset_response.cpp", 88 ] 89 } 90 91 defines = [ 92 "TELEPHONY_LOG_TAG = \"TelephonyCommon\"", 93 "LOG_DOMAIN = 0xD001F04", 94 ] 95 96 if (is_standard_system) { 97 defines += [ "STANDARD_SYSTEM_ENABLE" ] 98 } 99 100 configs = [ "../utils:telephony_log_config" ] 101 102 if (core_service_support_esim) { 103 configs += [ "../utils:telephony_codec_config" ] 104 } 105 106 public_configs = [ 107 ":tel_napi_config", 108 ":tel_utils_config", 109 ] 110 111 if (core_service_support_esim) { 112 public_configs += [ ":telephony_codec_config" ] 113 } 114 115 if (is_double_framework) { 116 cflags_cc = [ "-DCONFIG_DUAL_FRAMEWORK" ] 117 } 118 119 external_deps = [ 120 "access_token:libaccesstoken_sdk", 121 "access_token:libprivacy_sdk", 122 "access_token:libtokenid_sdk", 123 "bundle_framework:appexecfwk_base", 124 "bundle_framework:appexecfwk_core", 125 "c_utils:utils", 126 "eventhandler:libeventhandler", 127 "hilog:libhilog", 128 "hisysevent:libhisysevent", 129 "huks:libhukssdk", 130 "init:libbegetutil", 131 "ipc:ipc_single", 132 "napi:ace_napi", 133 "openssl:libcrypto_shared", 134 "preferences:native_preferences", 135 "samgr:samgr_proxy", 136 ] 137 138 deps = [] 139 140 if (use_clang_coverage) { 141 deps += [ "$SUBSYSTEM_DIR/core_service/test/mock/ffrt:ffrt_mocked" ] 142 } else { 143 external_deps += [ "ffrt:libffrt" ] 144 } 145 146 innerapi_tags = [ "platformsdk" ] 147 part_name = "core_service" 148 subsystem_name = "telephony" 149} 150 151ohos_shared_library("libtel_vcard") { 152 version_script = "libtel_vcard.versionscript" 153 sources = [ 154 "vcard/src/contact_data/vcard_anniversary_data.cpp", 155 "vcard/src/contact_data/vcard_birthday_data.cpp", 156 "vcard/src/contact_data/vcard_email_data.cpp", 157 "vcard/src/contact_data/vcard_event_data.cpp", 158 "vcard/src/contact_data/vcard_group_data.cpp", 159 "vcard/src/contact_data/vcard_im_data.cpp", 160 "vcard/src/contact_data/vcard_name_data.cpp", 161 "vcard/src/contact_data/vcard_nickname_data.cpp", 162 "vcard/src/contact_data/vcard_note_data.cpp", 163 "vcard/src/contact_data/vcard_organization_data.cpp", 164 "vcard/src/contact_data/vcard_phone_data.cpp", 165 "vcard/src/contact_data/vcard_photo_data.cpp", 166 "vcard/src/contact_data/vcard_postal_data.cpp", 167 "vcard/src/contact_data/vcard_relation_data.cpp", 168 "vcard/src/contact_data/vcard_sip_data.cpp", 169 "vcard/src/contact_data/vcard_uid_data.cpp", 170 "vcard/src/contact_data/vcard_website_data.cpp", 171 "vcard/src/vcard_configuration.cpp", 172 "vcard/src/vcard_constructor.cpp", 173 "vcard/src/vcard_contact.cpp", 174 "vcard/src/vcard_decoder.cpp", 175 "vcard/src/vcard_decoder_v21.cpp", 176 "vcard/src/vcard_decoder_v30.cpp", 177 "vcard/src/vcard_decoder_v40.cpp", 178 "vcard/src/vcard_encoder.cpp", 179 "vcard/src/vcard_file_utils.cpp", 180 "vcard/src/vcard_manager.cpp", 181 "vcard/src/vcard_raw_data.cpp", 182 "vcard/src/vcard_rdb_helper.cpp", 183 "vcard/src/vcard_utils.cpp", 184 ] 185 186 branch_protector_ret = "pac_ret" 187 188 defines = [ 189 "TELEPHONY_LOG_TAG = \"TelephonyVCard\"", 190 "LOG_DOMAIN = 0xD001F04", 191 ] 192 193 if (is_standard_system) { 194 defines += [ "STANDARD_SYSTEM_ENABLE" ] 195 } 196 197 configs = [ "../utils:telephony_log_config" ] 198 199 public_configs = [ ":tel_contact_config" ] 200 201 if (is_double_framework) { 202 cflags_cc = [ "-DCONFIG_DUAL_FRAMEWORK" ] 203 } 204 205 cflags_cc = [ 206 "-O2", 207 "-D_FORTIFY_SOURCE=2", 208 ] 209 210 include_dirs = [ 211 ":tel_contact_config", 212 "../interfaces/innerkits/include/", 213 ] 214 215 deps = [ ":libtel_common" ] 216 217 external_deps = [ 218 "ability_base:want", 219 "ability_base:zuri", 220 "ability_runtime:ability_manager", 221 "ability_runtime:data_ability_helper", 222 "c_utils:utils", 223 "data_share:datashare_common", 224 "data_share:datashare_consumer", 225 "hilog:libhilog", 226 "init:libbegetutil", 227 "i18n:intl_util", 228 ] 229 230 innerapi_tags = [ "platformsdk" ] 231 part_name = "core_service" 232 subsystem_name = "telephony" 233} 234