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  shared_library("libfaultloggerd") {
18    visibility = [ "*:*" ]
19
20    include_dirs = [
21      ".",
22      "include",
23      "$c_utils_include_path",
24      "$faultloggerd_common_path/cutil",
25      "$faultloggerd_common_path/dfxlog",
26      "$faultloggerd_common_path/dfxutil",
27      "$hilog_lite_include_path",
28    ]
29
30    sources = [
31      "faultloggerd_client.cpp",
32      "faultloggerd_socket.cpp",
33    ]
34    cflags = [ "-fstack-protector-strong" ]
35    sources += [ "$c_utils_src_path/directory_ex.cpp" ]
36
37    deps = [
38      "$faultloggerd_path/common/cutil:dfx_cutil",
39      "$faultloggerd_path/common/dfxlog:dfx_hilog",
40      "$faultloggerd_path/common/dfxutil:dfx_util",
41    ]
42
43    external_deps = [
44      "hilog_lite:hilog_shared",
45      "init:libbegetutil",
46    ]
47  }
48} else {
49  config("faultloggerd_client_config") {
50    visibility = [ "*:*" ]
51
52    include_dirs = [
53      "include",
54      "$faultloggerd_interfaces_path/common",
55    ]
56  }
57
58  ohos_shared_library("libfaultloggerd") {
59    branch_protector_ret = "pac_ret"
60    public_configs = [
61      ":faultloggerd_client_config",
62      "$faultloggerd_path/common/build:coverage_flags",
63    ]
64
65    sources = [
66      "faultloggerd_client.cpp",
67      "faultloggerd_socket.cpp",
68    ]
69    cflags = [ "-fstack-protector-strong" ]
70    include_dirs = [ "." ]
71    version_script = "libfaultloggerd.map"
72    deps = [
73      "$faultloggerd_common_path/cutil:dfx_cutil",
74      "$faultloggerd_common_path/dfxlog:dfx_hilog",
75      "$faultloggerd_common_path/dfxutil:dfx_util",
76    ]
77    external_deps = [
78      "c_utils:utils",
79      "hilog:libhilog",
80      "init:libbegetutil",
81    ]
82    install_images = [
83      "system",
84      "updater",
85    ]
86    innerapi_tags = [
87      "chipsetsdk_indirect",
88      "platformsdk_indirect",
89    ]
90    part_name = "faultloggerd"
91    subsystem_name = "hiviewdfx"
92  }
93}
94