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