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")
15
16config("faultlogger_service_ohos_private_config") {
17  include_dirs = [ "." ]
18}
19
20config("faultlogger_service_impl_config") {
21  include_dirs = [ "include" ]
22}
23
24ohos_source_set("faultlogger_service_ohos_common") {
25  part_name = "hiview"
26  sources = [
27    "src/faultlog_info_ohos.cpp",
28    "src/faultlog_query_result_proxy.cpp",
29    "src/faultlog_query_result_stub.cpp",
30    "src/faultlogger_service_proxy.cpp",
31    "src/faultlogger_service_stub.cpp",
32  ]
33
34  configs = [ ":faultlogger_service_ohos_private_config" ]
35
36  public_configs = [ ":faultlogger_service_impl_config" ]
37
38  deps = [ "$hiview_plugin/faultlogger/common:faultlogger_common" ]
39
40  external_deps = [
41    "c_utils:utils",
42    "hilog:libhilog",
43    "ipc:ipc_single",
44  ]
45}
46
47ohos_source_set("faultlogger_service_ohos_common_with_cfi") {
48  branch_protector_ret = "pac_ret"
49  sanitize = {
50    cfi = true
51    cfi_cross_dso = true
52    cfi_vcall_icall_only = true
53    debug = false
54  }
55  part_name = "hiview"
56  sources = [
57    "src/faultlog_info_ohos.cpp",
58    "src/faultlog_query_result_proxy.cpp",
59    "src/faultlog_query_result_stub.cpp",
60    "src/faultlogger_service_proxy.cpp",
61    "src/faultlogger_service_stub.cpp",
62  ]
63
64  configs = [ ":faultlogger_service_ohos_private_config" ]
65
66  public_configs = [ ":faultlogger_service_impl_config" ]
67
68  deps = [ "$hiview_plugin/faultlogger/common:faultlogger_common_with_cfi" ]
69
70  external_deps = [
71    "c_utils:utils",
72    "hilog:libhilog",
73    "ipc:ipc_single",
74  ]
75}
76
77ohos_source_set("faultlogger_service_impl") {
78  part_name = "hiview"
79  include_dirs = [ "$hiview_plugin/faultlogger/service" ]
80
81  sources = [
82    "faultlog_query_result_ohos.cpp",
83    "faultlogger_service_ohos.cpp",
84  ]
85
86  configs = [ ":faultlogger_service_ohos_private_config" ]
87
88  public_configs = [ ":faultlogger_service_impl_config" ]
89
90  deps = [
91    "$hiview_base:hiviewbase",
92    "$hiview_plugin/faultlogger/common:faultlogger_common",
93  ]
94
95  external_deps = [
96    "c_utils:utils",
97    "hilog:libhilog",
98    "ipc:ipc_single",
99    "jsoncpp:jsoncpp",
100    "safwk:system_ability_fwk",
101    "samgr:samgr_proxy",
102  ]
103}
104
105ohos_source_set("faultlogger_service_impl_with_cfi") {
106  sanitize = {
107    cfi = true
108    cfi_cross_dso = true
109    cfi_vcall_icall_only = true
110    debug = false
111  }
112  part_name = "hiview"
113  include_dirs = [ "$hiview_plugin/faultlogger/service" ]
114
115  sources = [
116    "faultlog_query_result_ohos.cpp",
117    "faultlogger_service_ohos.cpp",
118  ]
119
120  configs = [ ":faultlogger_service_ohos_private_config" ]
121
122  public_configs = [ ":faultlogger_service_impl_config" ]
123
124  deps = [
125    "$hiview_base:hiviewbase",
126    "$hiview_plugin/faultlogger/common:faultlogger_common_with_cfi",
127  ]
128
129  external_deps = [
130    "c_utils:utils",
131    "hilog:libhilog",
132    "ipc:ipc_single",
133    "jsoncpp:jsoncpp",
134    "safwk:system_ability_fwk",
135    "samgr:samgr_proxy",
136  ]
137}
138