1fb726d48Sopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd.
2fb726d48Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3fb726d48Sopenharmony_ci# you may not use this file except in compliance with the License.
4fb726d48Sopenharmony_ci# You may obtain a copy of the License at
5fb726d48Sopenharmony_ci#
6fb726d48Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7fb726d48Sopenharmony_ci#
8fb726d48Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9fb726d48Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10fb726d48Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11fb726d48Sopenharmony_ci# See the License for the specific language governing permissions and
12fb726d48Sopenharmony_ci# limitations under the License.
13fb726d48Sopenharmony_ciimport("//build/ohos.gni")
14fb726d48Sopenharmony_ciimport("//build/ts.gni")
15fb726d48Sopenharmony_ciconfig("faultloggerd_config") {
16fb726d48Sopenharmony_ci  cflags = [
17fb726d48Sopenharmony_ci    "-D ALWAYSTRUE",
18fb726d48Sopenharmony_ci    "-D DFX_NO_PRINT_LOG",
19fb726d48Sopenharmony_ci    "-D is_host",
20fb726d48Sopenharmony_ci  ]
21fb726d48Sopenharmony_ci  if (!is_independent_compile) {
22fb726d48Sopenharmony_ci    configs = [ "${TS_DIR}/gn:ts_config" ]
23fb726d48Sopenharmony_ci  }
24fb726d48Sopenharmony_ci}
25fb726d48Sopenharmony_ciconfig("faultloggerd_public_config") {
26fb726d48Sopenharmony_ci  include_dirs = [
27fb726d48Sopenharmony_ci    "faultloggerd/common/dfxlog",
28fb726d48Sopenharmony_ci    "faultloggerd/common/dfxutil",
29fb726d48Sopenharmony_ci    "faultloggerd/interfaces/common",
30fb726d48Sopenharmony_ci    "faultloggerd/interfaces/nonlinux",
31fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/include",
32fb726d48Sopenharmony_ci    "${THIRD_PARTY}/hiperf/include",
33fb726d48Sopenharmony_ci    "${THIRD_PARTY}/hiperf/include/nonlinux",
34fb726d48Sopenharmony_ci    "${THIRD_PARTY}/hiperf/include/nonlinux/linux",
35fb726d48Sopenharmony_ci    "${THIRD_PARTY}/bounds_checking_function/include",
36fb726d48Sopenharmony_ci    "${COMMON_LIBRARY}/base/include",
37fb726d48Sopenharmony_ci  ]
38fb726d48Sopenharmony_ci  if (is_mingw) {
39fb726d48Sopenharmony_ci    include_dirs += [ "${THIRD_PARTY}/libunwind/include/mingw" ]
40fb726d48Sopenharmony_ci  }
41fb726d48Sopenharmony_ci}
42fb726d48Sopenharmony_ciohos_source_set("libfaultloggerd") {
43fb726d48Sopenharmony_ci  sources = [
44fb726d48Sopenharmony_ci    "faultloggerd/common/dfxutil/dfx_util.cpp",
45fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/dfx_elf.cpp",
46fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/dfx_elf_parser.cpp",
47fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/dfx_map.cpp",
48fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/dfx_maps.cpp",
49fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/dfx_memory.cpp",
50fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/dfx_mmap.cpp",
51fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/dfx_symbols.cpp",
52fb726d48Sopenharmony_ci    "faultloggerd/interfaces/innerkits/unwinder/unwinder_config.cpp",
53fb726d48Sopenharmony_ci  ]
54fb726d48Sopenharmony_ci  configs += [ ":faultloggerd_config" ]
55fb726d48Sopenharmony_ci  public_configs = [ ":faultloggerd_public_config" ]
56fb726d48Sopenharmony_ci  public_deps = [ "${THIRD_PARTY}/bounds_checking_function:libsec_static" ]
57fb726d48Sopenharmony_ci  part_name = "faultloggerd"
58fb726d48Sopenharmony_ci  subsystem_name = "thirdparty"
59fb726d48Sopenharmony_ci}
60