1# Copyright (c) 2023 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("libdfx_procinfo") {
18    visibility = [ "*:*" ]
19
20    include_dirs = [
21      ".",
22      "include",
23      "$c_utils_include_path",
24      "$faultloggerd_interfaces_path/common",
25      "$faultloggerd_path/common/dfxutil",
26      "$hilog_lite_include_path",
27    ]
28
29    sources = [ "procinfo.cpp" ]
30    sources += [ "$c_utils_src_path/directory_ex.cpp" ]
31
32    deps = [
33      "$faultloggerd_path/common/dfxutil:dfx_util",
34      "$hilog_lite_deps_path",
35    ]
36
37    external_deps = [ "bounds_checking_function:libsec_shared" ]
38  }
39} else {
40  config("dfx_procinfo_config") {
41    visibility = [ "*:*" ]
42
43    include_dirs = [ "include" ]
44  }
45
46  ohos_shared_library("libdfx_procinfo") {
47    branch_protector_ret = "pac_ret"
48    public_configs = [
49      ":dfx_procinfo_config",
50      "$faultloggerd_path/common/build:coverage_flags",
51    ]
52    sources = [ "procinfo.cpp" ]
53
54    deps = [ "$faultloggerd_path/common/dfxutil:dfx_util" ]
55    version_script = "libprocinfo.map"
56    external_deps = [
57      "bounds_checking_function:libsec_shared",
58      "c_utils:utils",
59      "hilog:libhilog",
60    ]
61    install_images = [
62      "system",
63      "updater",
64    ]
65    innerapi_tags = [
66      "chipsetsdk_indirect",
67      "platformsdk_indirect",
68    ]
69    part_name = "faultloggerd"
70    subsystem_name = "hiviewdfx"
71  }
72
73  ohos_static_library("dfx_procinfo_static") {
74    public_configs = [ ":dfx_procinfo_config" ]
75
76    sources = [ "procinfo.cpp" ]
77
78    deps = [ "$faultloggerd_path/common/dfxutil:dfx_util_static" ]
79
80    external_deps = [
81      "bounds_checking_function:libsec_static",
82      "c_utils:utilsbase",
83    ]
84
85    part_name = "faultloggerd"
86    subsystem_name = "hiviewdfx"
87  }
88}
89