xref: /base/telephony/core_service/utils/BUILD.gn (revision 7859cbb8)
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/enum_convert.cpp",
68    "common/src/str_convert.cpp",
69    "common/src/tel_aes_crypto_util.cpp",
70    "common/src/tel_event_handler.cpp",
71    "common/src/tel_event_queue.cpp",
72    "common/src/telephony_common_utils.cpp",
73    "common/src/telephony_config.cpp",
74    "common/src/telephony_ext_utils_wrapper.cpp",
75    "common/src/telephony_permission.cpp",
76    "preferences/src/tel_profile_util.cpp",
77  ]
78
79  if (core_service_support_esim) {
80    sources += [
81      "codec/src/asn1_builder.cpp",
82      "codec/src/asn1_decoder.cpp",
83      "codec/src/asn1_node.cpp",
84      "codec/src/asn1_utils.cpp",
85      "codec/src/request_apdu_build.cpp",
86      "codec/src/reset_response.cpp",
87    ]
88  }
89
90  defines = [
91    "TELEPHONY_LOG_TAG = \"TelephonyCommon\"",
92    "LOG_DOMAIN = 0xD001F04",
93  ]
94
95  if (is_standard_system) {
96    defines += [ "STANDARD_SYSTEM_ENABLE" ]
97  }
98
99  configs = [ "../utils:telephony_log_config" ]
100
101  if (core_service_support_esim) {
102    configs += [ "../utils:telephony_codec_config" ]
103  }
104
105  public_configs = [
106    ":tel_napi_config",
107    ":tel_utils_config",
108  ]
109
110  if (is_double_framework) {
111    cflags_cc = [ "-DCONFIG_DUAL_FRAMEWORK" ]
112  }
113
114  external_deps = [
115    "access_token:libaccesstoken_sdk",
116    "access_token:libprivacy_sdk",
117    "access_token:libtokenid_sdk",
118    "bundle_framework:appexecfwk_base",
119    "bundle_framework:appexecfwk_core",
120    "c_utils:utils",
121    "eventhandler:libeventhandler",
122    "ffrt:libffrt",
123    "hilog:libhilog",
124    "hisysevent:libhisysevent",
125    "huks:libhukssdk",
126    "init:libbegetutil",
127    "ipc:ipc_single",
128    "napi:ace_napi",
129    "preferences:native_preferences",
130    "samgr:samgr_proxy",
131  ]
132
133  innerapi_tags = [ "platformsdk" ]
134  part_name = "core_service"
135  subsystem_name = "telephony"
136}
137
138ohos_shared_library("libtel_vcard") {
139  version_script = "libtel_vcard.versionscript"
140  sources = [
141    "vcard/src/contact_data/vcard_anniversary_data.cpp",
142    "vcard/src/contact_data/vcard_birthday_data.cpp",
143    "vcard/src/contact_data/vcard_email_data.cpp",
144    "vcard/src/contact_data/vcard_event_data.cpp",
145    "vcard/src/contact_data/vcard_group_data.cpp",
146    "vcard/src/contact_data/vcard_im_data.cpp",
147    "vcard/src/contact_data/vcard_name_data.cpp",
148    "vcard/src/contact_data/vcard_nickname_data.cpp",
149    "vcard/src/contact_data/vcard_note_data.cpp",
150    "vcard/src/contact_data/vcard_organization_data.cpp",
151    "vcard/src/contact_data/vcard_phone_data.cpp",
152    "vcard/src/contact_data/vcard_photo_data.cpp",
153    "vcard/src/contact_data/vcard_postal_data.cpp",
154    "vcard/src/contact_data/vcard_relation_data.cpp",
155    "vcard/src/contact_data/vcard_sip_data.cpp",
156    "vcard/src/contact_data/vcard_website_data.cpp",
157    "vcard/src/vcard_configuration.cpp",
158    "vcard/src/vcard_constructor.cpp",
159    "vcard/src/vcard_contact.cpp",
160    "vcard/src/vcard_decoder.cpp",
161    "vcard/src/vcard_decoder_v21.cpp",
162    "vcard/src/vcard_decoder_v30.cpp",
163    "vcard/src/vcard_decoder_v40.cpp",
164    "vcard/src/vcard_encoder.cpp",
165    "vcard/src/vcard_file_utils.cpp",
166    "vcard/src/vcard_manager.cpp",
167    "vcard/src/vcard_raw_data.cpp",
168    "vcard/src/vcard_rdb_helper.cpp",
169    "vcard/src/vcard_utils.cpp",
170  ]
171
172  defines = [
173    "TELEPHONY_LOG_TAG = \"TelephonyVCard\"",
174    "LOG_DOMAIN = 0xD001F04",
175  ]
176
177  if (is_standard_system) {
178    defines += [ "STANDARD_SYSTEM_ENABLE" ]
179  }
180
181  configs = [ "../utils:telephony_log_config" ]
182
183  public_configs = [ ":tel_contact_config" ]
184
185  if (is_double_framework) {
186    cflags_cc = [ "-DCONFIG_DUAL_FRAMEWORK" ]
187  }
188
189  cflags_cc = [
190    "-O2",
191    "-D_FORTIFY_SOURCE=2",
192  ]
193
194  include_dirs = [
195    ":tel_contact_config",
196    "../interfaces/innerkits/include/",
197    "//third_party/glib/glib",
198    "//third_party/glib",
199  ]
200
201  deps = [
202    ":libtel_common",
203    "//third_party/glib:glib_packages",
204  ]
205
206  external_deps = [
207    "ability_base:want",
208    "ability_base:zuri",
209    "ability_runtime:ability_manager",
210    "ability_runtime:data_ability_helper",
211    "c_utils:utils",
212    "data_share:datashare_common",
213    "data_share:datashare_consumer",
214    "hilog:libhilog",
215    "init:libbegetutil",
216  ]
217
218  innerapi_tags = [ "platformsdk" ]
219  part_name = "core_service"
220  subsystem_name = "telephony"
221}
222