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