• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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.
13
14import("//base/hiviewdfx/faultloggerd/faultloggerd.gni")
15
16if (defined(ohos_lite)) {
17  copy("faultlogger.cfg") {
18    sources = [ "$faultloggerd_path/services/config/faultloggerd.cfg" ]
19    outputs = [ "$root_out_dir/etc/init/faultloggerd.cfg" ]
20  }
21
22  copy("faultlogger.conf") {
23    sources = [ "$faultloggerd_path/services/config/faultlogger.conf" ]
24    outputs = [ "$root_out_dir/etc/faultlogger.conf" ]
25  }
26
27  executable("faultloggerd") {
28    visibility = [ "*:*" ]
29
30    include_dirs = [
31      ".",
32      "$faultloggerd_path/utils",
33      "//commonlibrary/c_utils/base/include",
34      "$faultloggerd_path/common",
35      "$faultloggerd_path/common/dfxlog",
36      "$faultloggerd_path/tools/process_dump",
37      "$hilog_lite_include_path",
38      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client/include",
39    ]
40
41    sources = [
42      "//base/hiviewdfx/faultloggerd/utils/directory_ex.cpp",
43      "fault_logger_config.cpp",
44      "fault_logger_daemon.cpp",
45      "fault_logger_pipe.cpp",
46      "fault_logger_secure.cpp",
47      "main.cpp",
48    ]
49
50    deps = [
51      ":faultlogger.conf",
52      "$faultloggerd_path/common/dfxlog:static_common_log",
53      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
54      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
55    ]
56  }
57} else {
58  config("faultloggerd_config") {
59    visibility = [ ":*" ]
60
61    include_dirs = [
62      ".",
63      "//commonlibrary/c_utils/base/include",
64      "$faultloggerd_path/common",
65      "$faultloggerd_path/common/dfxlog",
66      "$faultloggerd_path/tools/process_dump",
67    ]
68  }
69
70  ohos_prebuilt_etc("faultloggerd.cfg") {
71    if (use_musl) {
72      source = "config/faultloggerd.cfg"
73    } else {
74      source = "config/bionic/faultloggerd.cfg"
75    }
76
77    relative_install_dir = "init"
78    part_name = "faultloggerd"
79    subsystem_name = "hiviewdfx"
80  }
81
82  ohos_prebuilt_etc("faultlogger.conf") {
83    source = "config/faultlogger.conf"
84    part_name = "faultloggerd"
85    subsystem_name = "hiviewdfx"
86  }
87
88  ohos_executable("faultloggerd") {
89    install_enable = true
90    configs = [ ":faultloggerd_config" ]
91    sources = [
92      "fault_logger_config.cpp",
93      "fault_logger_daemon.cpp",
94      "fault_logger_pipe.cpp",
95      "fault_logger_secure.cpp",
96      "main.cpp",
97    ]
98
99    cflags_cc = [ "-DDEBUG_CRASH_LOCAL_HANDLER" ]
100
101    deps = [
102      ":faultlogger.conf",
103      "$faultloggerd_path/common/dfxlog:static_common_log",
104      "$faultloggerd_path/common/util:dfx_cutil",
105      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
106      "$faultloggerd_path/interfaces/innerkits/signal_handler:dfx_local_handler",
107    ]
108
109    if (!is_asan) {
110      deps += [ ":faultloggerd.cfg" ]
111    }
112
113    external_deps = [
114      "c_utils:utils",
115      "hilog_native:libhilog",
116    ]
117    install_images = [
118      "system",
119      "updater",
120    ]
121    part_name = "faultloggerd"
122    subsystem_name = "hiviewdfx"
123  }
124}
125