• 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    "hisysevent_util.cpp",
32    "panic_report_recovery.cpp",
33  ]
34
35  if (hiview_feature_bbox_userspace) {
36    sources += [ "panic_error_info_handle.cpp" ]
37    cflags = [ "-DBBOX_USERSPACE" ]
38  }
39
40  configs = [ ":bbox_detector_config" ]
41
42  external_deps = [
43    "bounds_checking_function:libsec_shared",
44    "hilog:libhilog",
45    "hisysevent:libhisysevent",
46    "init:libbegetutil",
47    "libxml2:libxml2",
48    "zlib:shared_libz",
49  ]
50
51  deps = [
52    "$hiview_base:hiviewbase",
53    "config:config",
54  ]
55}
56
57ohos_source_set("bbox_detector_with_cfi") {
58  sanitize = {
59    cfi = true
60    cfi_cross_dso = true
61    cfi_vcall_icall_only = true
62    debug = false
63  }
64  part_name = "hiview"
65  subsystem_name = "hiviewdfx"
66  sources = [
67    "bbox_detector_plugin.cpp",
68    "hisysevent_util.cpp",
69    "panic_report_recovery.cpp",
70  ]
71
72  if (hiview_feature_bbox_userspace) {
73    sources += [ "panic_error_info_handle.cpp" ]
74    cflags = [ "-DBBOX_USERSPACE" ]
75  }
76
77  configs = [ ":bbox_detector_config" ]
78
79  external_deps = [
80    "bounds_checking_function:libsec_shared",
81    "hilog:libhilog",
82    "hisysevent:libhisysevent",
83    "init:libbegetutil",
84    "libxml2:libxml2",
85    "zlib:shared_libz",
86  ]
87
88  deps = [
89    "$hiview_base:hiviewbase",
90    "config:config",
91  ]
92}
93
94group("unittest") {
95  testonly = true
96  deps = [ "test:BBoxDetectorUnitTest" ]
97}
98
99group("moduletest") {
100  testonly = true
101  deps = [ "test:BBoxDetectorModuleTest" ]
102}
103