1# Copyright (c) 2021-2022 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  executable("crasher_c") {
18    cflags = [
19      "-funwind-tables",
20      "-Wno-frame-larger-than",
21    ]
22
23    visibility = [ "*:*" ]
24    include_dirs = [
25      ".",
26      "$faultloggerd_interfaces_path/common",
27      "$hilog_lite_include_path",
28    ]
29    sources = [ "dfx_crasher.c" ]
30    deps = [ "$hilog_lite_deps_path" ]
31
32    external_deps = [ "bounds_checking_function:libsec_shared" ]
33  }
34} else {
35  config("crasher_config") {
36    visibility = [ ":*" ]
37
38    include_dirs = [
39      ".",
40      "$faultloggerd_interfaces_path/common",
41    ]
42    cflags = [ "-Wno-frame-larger-than" ]
43    cflags_c = [ "-Wno-frame-larger-than" ]
44    cflags_cc = [ "-Wno-frame-larger-than" ]
45    ldflags = [ "-Wno-frame-larger-than" ]
46  }
47
48  ohos_executable("crasher_c") {
49    configs = [
50      ":crasher_config",
51      "$faultloggerd_path/common/build:coverage_flags",
52    ]
53
54    branch_protector_ret = "pac_ret"
55    sources = [ "dfx_crasher.c" ]
56    external_deps = [ "hilog:libhilog" ]
57    part_name = "faultloggerd"
58    subsystem_name = "hiviewdfx"
59  }
60}
61