# Copyright (c) 2021-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/hiviewdfx/faultloggerd/faultloggerd.gni") dumpcatcherdemo_sources = [ "dump_catcher_demo.cpp" ] if (defined(ohos_lite)) { executable("dumpcatcherdemo") { sources = dumpcatcherdemo_sources visibility = [ "*:*" ] include_dirs = [ ".", "$c_utils_include_path", "$faultloggerd_path/interfaces/innerkits/dump_catcher/include/", "$faultloggerd_path/common", "$faultloggerd_path/common/dfxlog", "$faultloggerd_path/common/dfxutil", "$faultloggerd_path/interfaces/innerkits/faultloggerd_client/include", "$faultloggerd_path/tools/process_dump", "$hilog_lite_include_path", "//third_party/libunwind/include", "//third_party/libunwind/src", ] if (target_cpu == "arm") { include_dirs += [ "//third_party/libunwind/include/tdep-arm" ] } else if (target_cpu == "arm64") { include_dirs += [ "//third_party/libunwind/include/tdep-aarch64" ] } else if (target_cpu == "x64" || target_cpu == "x86_64") { include_dirs += [ "//third_party/libunwind/include/tdep-x86_64" ] } else if (target_cpu == "mipsel") { include_dirs += [ "//third_party/libunwind/include/tdep-mips" ] } defines = [ "HAVE_CONFIG_H", "HAVE_ELF_H", "HAVE_LINK_H", ] deps = [ "$faultloggerd_path/common/dfxlog:static_common_log", "$faultloggerd_path/common/dfxutil:dfx_util", "$faultloggerd_path/interfaces/innerkits/dump_catcher:libdfx_dumpcatcher", "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd", "$hilog_lite_deps_path", "//third_party/libunwind:libunwind", ] } } else { config("dumpcatcherdemo_config") { visibility = [ ":*" ] include_dirs = [ ".", "$faultloggerd_path/common", "$faultloggerd_path/common/dfxlog", "$faultloggerd_path/interfaces/innerkits/dump_catcher/include/", ] } ohos_executable("dumpcatcherdemo") { sources = dumpcatcherdemo_sources configs = [ ":dumpcatcherdemo_config" ] deps = [ "$faultloggerd_path/common/dfxlog:static_common_log", "$faultloggerd_path/interfaces/innerkits/dump_catcher:libdfx_dumpcatcher", ] external_deps = [ "c_utils:utils", "hilog:libhilog", ] part_name = "faultloggerd" subsystem_name = "hiviewdfx" } }