• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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.
13import("//base/hiviewdfx/hiview/hiview.gni")
14import("//build/ohos.gni")
15
16config("bbox_detector_config") {
17  visibility = [ ":*" ]
18  include_dirs = [
19    ".",
20    "include",
21    "$hiview_root/utility/smart_parser",
22    "$hiview_root/utility/common_utils/include",
23  ]
24}
25
26ohos_source_set("bbox_detector") {
27  part_name = "hiview"
28  subsystem_name = "hiviewdfx"
29  sources = [
30    "bbox_detector_plugin.cpp",
31    "bbox_event_recorder.cpp",
32    "hisysevent_util.cpp",
33    "panic_report_recovery.cpp",
34  ]
35
36  if (hiview_feature_bbox_userspace) {
37    sources += [ "panic_error_info_handle.cpp" ]
38    cflags = [ "-DBBOX_USERSPACE" ]
39  }
40
41  configs = [ ":bbox_detector_config" ]
42
43  external_deps = [
44    "bounds_checking_function:libsec_shared",
45    "c_utils:utils",
46    "hilog:libhilog",
47    "hisysevent:libhisysevent",
48    "init:libbegetutil",
49    "libxml2:libxml2",
50    "zlib:shared_libz",
51  ]
52
53  deps = [
54    "$hiview_base:hiviewbase",
55    "config:config",
56  ]
57}
58
59ohos_source_set("bbox_detector_with_cfi") {
60  sanitize = {
61    cfi = true
62    cfi_cross_dso = true
63    cfi_vcall_icall_only = true
64    debug = false
65  }
66  part_name = "hiview"
67  subsystem_name = "hiviewdfx"
68  sources = [
69    "bbox_detector_plugin.cpp",
70    "bbox_event_recorder.cpp",
71    "hisysevent_util.cpp",
72    "panic_report_recovery.cpp",
73  ]
74
75  if (hiview_feature_bbox_userspace) {
76    sources += [ "panic_error_info_handle.cpp" ]
77    cflags = [ "-DBBOX_USERSPACE" ]
78  }
79
80  configs = [ ":bbox_detector_config" ]
81
82  external_deps = [
83    "bounds_checking_function:libsec_shared",
84    "c_utils:utils",
85    "hilog:libhilog",
86    "hisysevent:libhisysevent",
87    "init:libbegetutil",
88    "libxml2:libxml2",
89    "zlib:shared_libz",
90  ]
91
92  deps = [
93    "$hiview_base:hiviewbase",
94    "config:config",
95  ]
96}
97
98group("unittest") {
99  testonly = true
100  deps = [ "test:BBoxDetectorUnitTest" ]
101}
102
103group("moduletest") {
104  testonly = true
105  deps = [ "test:BBoxDetectorModuleTest" ]
106}
107