1# Copyright (c) 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("../dsoftbus.gni") 15 16softbus_anonymizer_src = [ "anonymize/src/anonymizer.c" ] 17softbus_log_src = [ "log/src/softbus_log.c" ] 18if (defined(ohos_lite)) { 19 softbus_event_src = [ "event/src/softbus_event_virtual.c" ] 20} else { 21 softbus_event_src = [ 22 "event/src/conn_event.c", 23 "event/src/disc_event.c", 24 "event/src/lnn_event.c", 25 "event/src/softbus_event.c", 26 "event/src/stats_event.c", 27 "event/src/trans_event.c", 28 ] 29} 30 31if (defined(ohos_lite)) { 32 if (ohos_kernel_type == "liteos_m") { 33 build_type = "static_library" 34 libsec_external_deps = [ "bounds_checking_function:libsec_static" ] 35 } else { 36 build_type = "shared_library" 37 libsec_external_deps = [ "bounds_checking_function:libsec_shared" ] 38 } 39 config("dsoftbus_dfx_interface_lite") { 40 include_dirs = [ 41 "interface/include", 42 "$dsoftbus_root_path/interfaces/kits/common", 43 "$hilog_lite_include_path", 44 "$utils_lite_include_path", 45 ] 46 cflags = ohos_lite_cflags 47 cflags_cc = ohos_lite_cflags 48 } 49 50 target(build_type, "softbus_dfx") { 51 include_dirs = [ 52 "event/src", 53 "interface/include", 54 "$dsoftbus_root_path/interfaces/kits/common", 55 ] 56 sources = softbus_anonymizer_src + softbus_log_src + softbus_event_src 57 deps = [ "$hilog_lite_deps_path" ] 58 external_deps = libsec_external_deps 59 public_configs = [ ":dsoftbus_dfx_interface_lite" ] 60 } 61} else { 62 config("dsoftbus_dfx_interface_std") { 63 include_dirs = [ 64 "interface/include", 65 "$dsoftbus_root_path/interfaces/kits/common", 66 ] 67 } 68 ohos_shared_library("softbus_dfx") { 69 sanitize = { 70 ubsan = true 71 integer_overflow = true 72 boundary_sanitize = true 73 cfi = true 74 cfi_cross_dso = true 75 debug = false 76 } 77 branch_protector_ret = "pac_ret" 78 include_dirs = [ 79 "event/src", 80 "interface/include", 81 "$dsoftbus_root_path/interfaces/kits/common", 82 ] 83 sources = softbus_anonymizer_src + softbus_log_src + softbus_event_src 84 defines += [ "__STDC_FORMAT_MACROS" ] 85 if (is_asan) { 86 defines += [ "ASAN_BUILD" ] 87 } 88 89 public_configs = [ ":dsoftbus_dfx_interface_std" ] 90 public_external_deps = [ 91 "bounds_checking_function:libsec_shared", 92 "hilog:libhilog", 93 "hisysevent:libhisysevent", 94 ] 95 innerapi_tags = [ "platformsdk_indirect" ] 96 part_name = "dsoftbus" 97 subsystem_name = "communication" 98 } 99} 100