1# Copyright (c) 2021-2024 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("../../../transmission/common/trans_common.gni") 15import("../dsoftbus_dfx.gni") 16 17dsoftbus_root_path = "../../../.." 18softbus_adapter_common = "${dsoftbus_root_path}/adapter/common" 19 20if (defined(ohos_lite)) { 21 if (ohos_kernel_type == "liteos_m") { 22 build_type = "static_library" 23 libsec_external_deps = [ "bounds_checking_function:libsec_static" ] 24 } else { 25 build_type = "shared_library" 26 libsec_external_deps = [ "bounds_checking_function:libsec_shared" ] 27 } 28 config("dsoftbus_dump_interface_lite") { 29 include_dirs = [ 30 "$dsoftbus_dfx_path/hidumper_adapter/include", 31 "$dsoftbus_root_path/interfaces/kits/common", 32 "$dsoftbus_root_path/core/common/include", 33 "$softbus_adapter_common/include", 34 ] 35 cflags = ohos_lite_cflags 36 cflags_cc = ohos_lite_cflags 37 } 38 39 target(build_type, "softbus_dfx_dump") { 40 include_dirs = [ 41 "$dsoftbus_dfx_path/event/src", 42 "$dsoftbus_root_path/core/common/dfx/interface/include", 43 "$dsoftbus_root_path/core/transmission/common/include", 44 "$dsoftbus_root_path/interfaces/kits/transport", 45 "$hilog_lite_include_path", 46 ] 47 sources = [ 48 "softbus_hidumper.c", 49 "softbus_hidumper_alarm_virtual.c", 50 "softbus_hidumper_bc_mgr_virtual.c", 51 "softbus_hidumper_broadcast_virtual.c", 52 "softbus_hidumper_buscenter_virtual.c", 53 "softbus_hidumper_conn_virtual.c", 54 "softbus_hidumper_disc_virtual.c", 55 "softbus_hidumper_interface_virtual.c", 56 "softbus_hidumper_nstack_virtual.c", 57 "softbus_hidumper_stats_virtual.c", 58 "softbus_hidumper_trans_virtual.c", 59 "softbus_hidumper_util_virtual.c", 60 ] 61 external_deps = libsec_external_deps 62 public_configs = [ ":dsoftbus_dump_interface_lite" ] 63 } 64} else { 65 cflags = [ "-DFILLP_LINUX" ] 66 config("dsoftbus_dump_interface_std") { 67 include_dirs = [ 68 "$dsoftbus_dfx_path/hidumper_adapter/include", 69 "$dsoftbus_root_path/core/common/include", 70 "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile/interface", 71 "$softbus_adapter_common/include", 72 ] 73 } 74 ohos_shared_library("softbus_dfx_dump") { 75 sanitize = { 76 ubsan = true 77 integer_overflow = true 78 boundary_sanitize = true 79 cfi = true 80 cfi_cross_dso = true 81 debug = false 82 } 83 branch_protector_ret = "pac_ret" 84 include_dirs = [ 85 "$dsoftbus_dfx_path/interface/include", 86 "$dsoftbus_dfx_path/event/src", 87 "$dsoftbus_root_path/interfaces/kits/common", 88 "$dsoftbus_root_path/components/nstackx/fillp/include", 89 "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile/interface", 90 "$dsoftbus_root_path/components/nstackx/nstackx_util/interface", 91 "$dsoftbus_root_path/components/nstackx/nstackx_ctrl/interface", 92 "$dsoftbus_root_path/core/bus_center/utils/include", 93 "$dsoftbus_root_path/core/authentication/interface", 94 "$dsoftbus_root_path/core/bus_center/interface", 95 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 96 "$dsoftbus_root_path/core/connection/interface", 97 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 98 ] 99 include_dirs += trans_common_inc 100 sources = [ 101 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_map.c", 102 "$dsoftbus_root_path/core/common/message_handler/message_handler.c", 103 "$dsoftbus_root_path/core/common/softbus_property/softbus_feature_config.c", 104 "$dsoftbus_root_path/core/common/utils/softbus_utils.c", 105 "softbus_hidumper.c", 106 107 # "$softbus_adapter_common/kernel/liteos_m/softbus_adapter_timer.c", 108 "softbus_hidumper_alarm.c", 109 "softbus_hidumper_bc_mgr.c", 110 "softbus_hidumper_broadcast.c", 111 "softbus_hidumper_buscenter.c", 112 "softbus_hidumper_conn.c", 113 "softbus_hidumper_disc.c", 114 "softbus_hidumper_interface.c", 115 "softbus_hidumper_nstack.c", 116 "softbus_hidumper_stats.c", 117 "softbus_hidumper_trans.c", 118 "softbus_hidumper_util.c", 119 ] 120 defines += [ "__STDC_FORMAT_MACROS" ] 121 if (is_asan) { 122 defines += [ "ASAN_BUILD" ] 123 } 124 125 public_configs = [ ":dsoftbus_dump_interface_std" ] 126 public_deps = [ 127 "$dsoftbus_dfx_path/anonymize:softbus_dfx_anonymizer", 128 "$dsoftbus_dfx_path/event:softbus_dfx_event", 129 "$dsoftbus_dfx_path/log:softbus_dfx_log", 130 "$dsoftbus_root_path/adapter:softbus_adapter", 131 ] 132 public_external_deps = [ 133 "bounds_checking_function:libsec_shared", 134 "cJSON:cjson", 135 "sqlite:sqlite", 136 ] 137 external_deps = [ 138 "bounds_checking_function:libsec_shared", 139 "cJSON:cjson", 140 "hilog:libhilog", 141 "hisysevent:libhisysevent", 142 "hisysevent:libhisyseventmanager", 143 ] 144 145 innerapi_tags = [ "platformsdk_indirect" ] 146 part_name = "dsoftbus" 147 subsystem_name = "communication" 148 } 149} 150