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