1# Copyright (c) 2024 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")
15if (defined(ohos_lite)) {
16  config("dfx_trace_config") {
17    visibility = [ "*:*" ]
18    include_dirs = [ "include" ]
19  }
20  source_set("dfx_trace_dlsym") {
21    public_configs = [ ":dfx_trace_config" ]
22    sources = [ "dfx_trace_dlsym.cpp" ]
23  }
24
25  source_set("dfx_trace") {
26    public_configs = [ ":dfx_trace_config" ]
27    sources = [ "dfx_trace.cpp" ]
28  }
29} else {
30  config("dfx_trace_config") {
31    visibility = [ "*:*" ]
32    include_dirs = [ "include" ]
33  }
34  ohos_source_set("dfx_trace_dlsym") {
35    public_configs = [ ":dfx_trace_config" ]
36    defines = [
37      "DFX_ENABLE_TRACE",
38      "is_ohos=${is_ohos}",
39      "is_mingw=${is_mingw}",
40    ]
41    sources = [ "dfx_trace_dlsym.cpp" ]
42    cflags = [ "-fstack-protector-strong" ]
43    if (is_ohos && !is_mingw) {
44      external_deps = [ "bounds_checking_function:libsec_shared" ]
45    }
46    part_name = "faultloggerd"
47    subsystem_name = "hiviewdfx"
48  }
49
50  ohos_source_set("dfx_trace") {
51    public_configs = [ ":dfx_trace_config" ]
52    defines = [ "DFX_ENABLE_TRACE" ]
53    sources = [ "dfx_trace.cpp" ]
54    cflags = [ "-fstack-protector-strong" ]
55    external_deps = [
56      "bounds_checking_function:libsec_shared",
57      "hitrace:hitrace_meter",
58    ]
59    part_name = "faultloggerd"
60    subsystem_name = "hiviewdfx"
61  }
62}
63