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 16dumpcatcher_sources = [ "dfx_dump_catcher.cpp" ] 17 18if (defined(ohos_lite)) { 19 shared_library("libdfx_dumpcatcher") { 20 visibility = [ "*:*" ] 21 22 include_dirs = [ 23 "include", 24 "$c_utils_include_path", 25 "$faultloggerd_common_path/dfxlog", 26 "$faultloggerd_common_path/dfxutil", 27 "$faultloggerd_frameworks_path/unwind/include", 28 "$faultloggerd_interfaces_path/common", 29 "$faultloggerd_interfaces_path/innerkits/backtrace/include", 30 "$faultloggerd_interfaces_path/innerkits/faultloggerd_client/include", 31 "$faultloggerd_interfaces_path/innerkits/procinfo/include", 32 "$hilog_lite_include_path", 33 "//third_party/libunwind/include", 34 "//third_party/libunwind/src", 35 ] 36 37 if (target_cpu == "arm") { 38 include_dirs += [ "//third_party/libunwind/include/tdep-arm" ] 39 } else if (target_cpu == "arm64") { 40 include_dirs += [ "//third_party/libunwind/include/tdep-aarch64" ] 41 } else if (target_cpu == "x64" || target_cpu == "x86_64") { 42 include_dirs += [ "//third_party/libunwind/include/tdep-x86_64" ] 43 } else if (target_cpu == "mipsel") { 44 include_dirs += [ "//third_party/libunwind/include/tdep-mips" ] 45 } else if (target_cpu == "riscv64") { 46 include_dirs += [ "//third_party/libunwind/include/tdep-riscv" ] 47 } 48 49 sources = dumpcatcher_sources 50 51 defines = [ 52 "HAVE_CONFIG_H", 53 "HAVE_ELF_H", 54 "HAVE_LINK_H", 55 ] 56 57 deps = [ 58 "$faultloggerd_common_path/dfxlog:dfx_hilog", 59 "$faultloggerd_common_path/dfxutil:dfx_util", 60 "$faultloggerd_interfaces_path/innerkits/backtrace:libbacktrace_local", 61 "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd", 62 "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo", 63 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 64 "//third_party/bounds_checking_function:libsec_shared", 65 "//third_party/libunwind:libunwind", 66 ] 67 } 68} else { 69 config("dfx_dump_catcher_config") { 70 visibility = [ "*:*" ] 71 72 include_dirs = [ "include" ] 73 defines = [ 74 "HAVE_CONFIG_H", 75 "HAVE_ELF_H", 76 "HAVE_LINK_H", 77 ] 78 } 79 80 ohos_shared_library("libdfx_dumpcatcher") { 81 public_configs = [ 82 ":dfx_dump_catcher_config", 83 "$faultloggerd_path/common/build:coverage_flags", 84 ] 85 sources = dumpcatcher_sources 86 include_dirs = [ 87 "$faultloggerd_interfaces_path/common", 88 "//third_party/libunwind/include", 89 "//third_party/libunwind/src", 90 ] 91 if (target_cpu == "arm") { 92 include_dirs += [ "//third_party/libunwind/include/tdep-arm" ] 93 } else if (target_cpu == "arm64") { 94 include_dirs += [ "//third_party/libunwind/include/tdep-aarch64" ] 95 } else if (target_cpu == "x64" || target_cpu == "x86_64") { 96 include_dirs += [ "//third_party/libunwind/include/tdep-x86_64" ] 97 } else if (target_cpu == "mipsel") { 98 include_dirs += [ "//third_party/libunwind/include/tdep-mips" ] 99 } else if (target_cpu == "riscv64") { 100 include_dirs += [ "//third_party/libunwind/include/tdep-riscv" ] 101 } 102 version_script = "libdfx_dumpcatcher.map" 103 deps = [ 104 "$faultloggerd_common_path/dfxlog:dfx_hilog", 105 "$faultloggerd_common_path/dfxutil:dfx_util", 106 "$faultloggerd_interfaces_path/innerkits/backtrace:libbacktrace_local", 107 "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd", 108 "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo", 109 ] 110 111 external_deps = [ 112 "c_utils:utils", 113 "hilog:libhilog", 114 ] 115 install_images = [ 116 "system", 117 "updater", 118 ] 119 innerapi_tags = [ 120 "chipsetsdk_indirect", 121 "platformsdk_indirect", 122 "sasdk", 123 ] 124 part_name = "faultloggerd" 125 subsystem_name = "hiviewdfx" 126 } 127} 128