• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024-2025 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      "$dsoftbus_root_path/interfaces/kits/common",
65      "event/src",
66      "interface/include",
67      "interface/include/form",
68      "interface/include/legacy",
69    ]
70  }
71  ohos_shared_library("softbus_dfx") {
72    sanitize = {
73      ubsan = true
74      integer_overflow = true
75      boundary_sanitize = true
76      cfi = true
77      cfi_cross_dso = true
78      debug = false
79    }
80    branch_protector_ret = "pac_ret"
81    include_dirs = [
82      "event/src",
83      "interface/include",
84      "$dsoftbus_root_path/interfaces/kits/common",
85    ]
86    sources = softbus_anonymizer_src + softbus_log_src + softbus_event_src
87    defines += [ "__STDC_FORMAT_MACROS" ]
88    if (is_asan) {
89      defines += [ "ASAN_BUILD" ]
90    }
91
92    public_configs = [ ":dsoftbus_dfx_interface_std" ]
93    public_external_deps = [
94      "bounds_checking_function:libsec_shared",
95      "hilog:libhilog",
96      "hisysevent:libhisysevent",
97    ]
98    innerapi_tags = [ "platformsdk_indirect" ]
99    part_name = "dsoftbus"
100    subsystem_name = "communication"
101  }
102}
103