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. 13import("//build/config/components/idl_tool/idl.gni") 14import("//build/ohos.gni") 15 16SUBSYSTEM_DIR = "../.." 17config("cellular_data_util_config") { 18 # header file path 19 include_dirs = [ 20 "${target_gen_dir}", 21 "$SUBSYSTEM_DIR/interfaces/innerkits", 22 "$SUBSYSTEM_DIR/services/include/apn_manager", 23 "$SUBSYSTEM_DIR/services/include/common", 24 ] 25 26 cflags = [] 27 if (is_double_framework) { 28 cflags = [ "-DCONFIG_DUAL_FRAMEWORK" ] 29 } 30 if (target_cpu == "arm") { 31 cflags += [ "-DBINDER_IPC_32BIT" ] 32 } 33 if (is_standard_system) { 34 cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] 35 } 36 if (defined(build_public_version) && build_public_version) { 37 cflags += [ "-DBUILD_PUBLIC_VERSION" ] 38 } 39} 40 41config("cellulardata_interface_config") { 42 include_dirs = [ 43 "${target_gen_dir}", 44 "${target_gen_dir}/callback", 45 "${target_gen_dir}/type", 46 "$SUBSYSTEM_DIR/interfaces/innerkits", 47 "$SUBSYSTEM_DIR/services/include", 48 "$SUBSYSTEM_DIR/services/include/apn_manager", 49 "$SUBSYSTEM_DIR/services/include/common", 50 "$SUBSYSTEM_DIR/services/include/state_machine", 51 "$SUBSYSTEM_DIR/services/include/utils", 52 ] 53} 54 55idl_gen_interface("cellulardata_interface") { 56 sources = [ "ICellularDataManager.idl" ] 57 log_domainid = "0xD001F03" 58 log_tag = "CellularDataApi" 59} 60 61ohos_source_set("cellulardata_interface_stub") { 62 sanitize = { 63 cfi = true 64 cfi_cross_dso = true 65 debug = false 66 } 67 public_configs = [ ":cellulardata_interface_config" ] 68 output_values = get_target_outputs(":cellulardata_interface") 69 sources = [] 70 sources += filter_include(output_values, [ "*_stub.cpp" ]) 71 deps = [ ":cellulardata_interface" ] 72 external_deps = [ 73 "core_service:libtel_common", 74 "core_service:tel_core_service_api", 75 "hilog:libhilog", 76 "ipc:ipc_single", 77 "samgr:samgr_proxy", 78 "telephony_data:tel_telephony_data", 79 "c_utils:utils", 80 ] 81 part_name = "cellular_data" 82 subsystem_name = "telephony" 83} 84 85ohos_shared_library("tel_cellular_data_api") { 86 sanitize = { 87 cfi = true 88 cfi_cross_dso = true 89 debug = false 90 } 91 branch_protector_ret = "pac_ret" 92 sources = [ 93 "$SUBSYSTEM_DIR/frameworks/native/apn_activate_report_info.cpp", 94 "$SUBSYSTEM_DIR/frameworks/native/apn_attribute.cpp", 95 "$SUBSYSTEM_DIR/frameworks/native/cellular_data_client.cpp", 96 "$SUBSYSTEM_DIR/frameworks/native/data_sim_account_callback.cpp", 97 "$SUBSYSTEM_DIR/frameworks/native/sim_account_callback_stub.cpp", 98 ] 99 output_values = get_target_outputs(":cellulardata_interface") 100 sources += filter_include(output_values, [ "*_proxy.cpp" ]) 101 version_script = "$SUBSYSTEM_DIR/interfaces/innerkits/libtel_cellular_data_api.versionscript" 102 103 public_configs = [ ":cellular_data_util_config" ] 104 105 deps = [ ":cellulardata_interface" ] 106 107 external_deps = [ 108 "c_utils:utils", 109 "core_service:libtel_common", 110 "core_service:tel_core_service_api", 111 "hilog:libhilog", 112 "init:libbegetutil", 113 "ipc:ipc_single", 114 "samgr:samgr_proxy", 115 "telephony_data:tel_telephony_data", 116 ] 117 defines = [ 118 "TELEPHONY_LOG_TAG = \"CellularDataApi\"", 119 "LOG_DOMAIN = 0xD001F03", 120 ] 121 122 cflags_cc = [ 123 "-O2", 124 "-D_FORTIFY_SOURCE=2", 125 ] 126 127 innerapi_tags = [ "platformsdk" ] 128 part_name = "cellular_data" 129 subsystem_name = "telephony" 130} 131