1# Copyright (c) 2021-2024 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("//base/hiviewdfx/faultloggerd/faultloggerd.gni")
15
16dumpcatcherdemo_sources = [ "dump_catcher_demo.cpp" ]
17
18if (defined(ohos_lite)) {
19  executable("dumpcatcherdemo") {
20    sources = dumpcatcherdemo_sources
21
22    visibility = [ "*:*" ]
23    defines = [ "is_ohos_lite" ]
24
25    include_dirs = [
26      ".",
27      "$c_utils_include_path",
28      "$faultloggerd_common_path/dfxlog",
29      "$faultloggerd_common_path/dfxutil",
30      "$faultloggerd_interfaces_path/common",
31      "$faultloggerd_interfaces_path/innerkits/backtrace/include/",
32      "$faultloggerd_interfaces_path/innerkits/dump_catcher/include/",
33      "$faultloggerd_interfaces_path/innerkits/faultloggerd_client/include",
34      "$hilog_lite_include_path",
35    ]
36
37    deps = [
38      "$faultloggerd_common_path/dfxlog:dfx_hilog",
39      "$faultloggerd_common_path/dfxutil:dfx_util",
40      "$faultloggerd_interfaces_path/innerkits/dump_catcher:libdfx_dumpcatcher",
41      "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd",
42      "$hilog_lite_deps_path",
43    ]
44  }
45} else {
46  config("dumpcatcherdemo_config") {
47    visibility = [ ":*" ]
48
49    include_dirs = [
50      ".",
51      "$faultloggerd_common_path/dfxutil",
52      "$faultloggerd_interfaces_path/common",
53    ]
54  }
55
56  ohos_executable("dumpcatcherdemo") {
57    sources = dumpcatcherdemo_sources
58
59    configs = [ ":dumpcatcherdemo_config" ]
60
61    deps = [
62      "$faultloggerd_common_path/dfxlog:dfx_hilog",
63      "$faultloggerd_interfaces_path/innerkits/dump_catcher:libdfx_dumpcatcher",
64      "$faultloggerd_interfaces_path/innerkits/formatter:libjson_stack_formatter",
65    ]
66
67    external_deps = [
68      "c_utils:utils",
69      "hilog:libhilog",
70      "jsoncpp:jsoncpp",
71    ]
72
73    part_name = "faultloggerd"
74    subsystem_name = "hiviewdfx"
75  }
76}
77