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.
13import("//base/hiviewdfx/hiview/hiview.gni")
14import("//build/ohos.gni")
15config("faultlogger_common_config") {
16  visibility = [ "*:*" ]
17  include_dirs = [ "." ]
18}
19
20ohos_source_set("log_analyzer") {
21  include_dirs = [
22    "//base/hiviewdfx/hiview/utility/smart_parser",
23    "//base/hiviewdfx/hiview/utility/common_utils/include",
24  ]
25
26  public_configs = [ ":faultlogger_common_config" ]
27
28  sources = [ "log_analyzer.cpp" ]
29
30  deps = [
31    ":faultlogger_common",
32    "$hiview_root/utility/common_utils:hiview_reliability_common_utils",
33    "$hiview_root/utility/smart_parser:smart_parser",
34  ]
35
36  external_deps = [
37    "bounds_checking_function:libsec_shared",
38    "hilog:libhilog",
39  ]
40
41  part_name = "hiview"
42}
43
44ohos_source_set("log_analyzer_with_cfi") {
45  sanitize = {
46    cfi = true
47    cfi_cross_dso = true
48    cfi_vcall_icall_only = true
49    debug = false
50  }
51
52  include_dirs = [
53    "//base/hiviewdfx/hiview/utility/smart_parser",
54    "//base/hiviewdfx/hiview/utility/common_utils/include",
55  ]
56
57  public_configs = [ ":faultlogger_common_config" ]
58
59  sources = [ "log_analyzer.cpp" ]
60
61  deps = [
62    ":faultlogger_common_with_cfi",
63    "$hiview_root/utility/common_utils:hiview_reliability_common_utils_with_cfi",
64    "$hiview_root/utility/smart_parser:smart_parser_with_cfi",
65  ]
66
67  external_deps = [
68    "bounds_checking_function:libsec_shared",
69    "hilog:libhilog",
70  ]
71
72  part_name = "hiview"
73}
74
75ohos_source_set("faultlogger_common") {
76  public_configs = [ ":faultlogger_common_config" ]
77  sources = [
78    "faultlog_query_result_inner.cpp",
79    "faultlog_util.cpp",
80  ]
81
82  deps = [
83    "$hiview_base:hiviewbase",
84    "$hiview_base/event_raw:hiview_event_raw_encode",
85  ]
86
87  external_deps = [ "hilog:libhilog" ]
88
89  part_name = "hiview"
90}
91
92ohos_source_set("faultlogger_common_with_cfi") {
93  branch_protector_ret = "pac_ret"
94  sanitize = {
95    cfi = true
96    cfi_cross_dso = true
97    cfi_vcall_icall_only = true
98    debug = false
99  }
100  public_configs = [ ":faultlogger_common_config" ]
101  sources = [
102    "faultlog_query_result_inner.cpp",
103    "faultlog_util.cpp",
104  ]
105
106  deps = [ "$hiview_base:hiviewbase" ]
107
108  external_deps = [ "hilog:libhilog" ]
109
110  part_name = "hiview"
111}
112