1# Copyright (c) 2021-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("libasync_stack") {
18    include_dirs = [
19      "include",
20      ".",
21      "$faultloggerd_interfaces_path/common",
22      "$faultloggerd_common_path/dfxutil",
23    ]
24    sources = [
25      "async_stack.cpp",
26      "fp_unwinder.cpp",
27      "unique_stack_table.cpp",
28    ]
29    defines = [
30      "is_ohos=${is_ohos}",
31      "is_ohos_lite",
32    ]
33    deps = [
34      "$faultloggerd_path/common/cutil:dfx_cutil",
35      "$faultloggerd_path/common/dfxlog:dfx_hilog",
36    ]
37
38    external_deps = [ "bounds_checking_function:libsec_static" ]
39  }
40} else {
41  config("async_stack_config") {
42    visibility = [ "*:*" ]
43
44    include_dirs = [
45      "include",
46      ".",
47      "$faultloggerd_interfaces_path/common",
48      "$faultloggerd_common_path/dfxutil",
49    ]
50  }
51
52  ohos_shared_library("libasync_stack") {
53    public_configs = [ ":async_stack_config" ]
54    defines = [
55      "is_ohos=${is_ohos}",
56      "ENABLE_PARAMETER",
57    ]
58
59    sources = [
60      "async_stack.cpp",
61      "fp_unwinder.cpp",
62      "unique_stack_table.cpp",
63    ]
64    deps = [ "$faultloggerd_common_path/dfxlog:dfx_hilog" ]
65    external_deps = [
66      "c_utils:utils",
67      "hilog:libhilog",
68      "init:libbegetutil",
69    ]
70    version_script = "libasync_stack.map"
71    install_images = [
72      "system",
73      "updater",
74    ]
75
76    innerapi_tags = [
77      "chipsetsdk_indirect",
78      "platformsdk_indirect",
79    ]
80
81    part_name = "faultloggerd"
82    subsystem_name = "hiviewdfx"
83  }
84}
85