• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/hitrace/hitrace.gni")
15import("//build/ohos.gni")
16
17config("libhitrace_pub_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [ "include" ]
21}
22
23ohos_shared_library("libhitracechain") {
24  branch_protector_ret = "pac_ret"
25  public_configs = [ ":libhitrace_pub_config" ]
26
27  deps = [ "$hitrace_frameworks_path/native:hitracechain_source" ]
28
29  cflags = [ "-fstack-protector-strong" ]
30
31  if (defined(ohos_lite)) {
32    external_deps = [ "hilog_lite:hilog_lite" ]
33  } else {
34    external_deps = [ "hilog:libhilog" ]
35  }
36
37  output_extension = "so"
38  if (build_public_version) {
39    install_enable = true
40  } else {
41    install_enable = false
42  }
43
44  innerapi_tags = [
45    "chipsetsdk_indirect",
46    "platformsdk",
47  ]
48
49  version_script = "libhitracechain.map"
50
51  install_images = [
52    "system",
53    "updater",
54  ]
55
56  part_name = "hitrace"
57  subsystem_name = "hiviewdfx"
58}
59
60config("hitrace_meter_config") {
61  visibility = [ ":*" ]
62  include_dirs = [ "include/hitrace_meter" ]
63}
64
65ohos_static_library("hitrace_inner") {
66  branch_protector_ret = "pac_ret"
67  include_dirs = [
68    "include/hitrace_meter",
69    "include",
70    "$hitrace_frameworks_path/include/",
71  ]
72  sources = [
73    "src/hitrace_meter.cpp",
74    "src/hitrace_meter_c.c",
75    "src/hitrace_meter_wrapper.cpp",
76  ]
77
78  external_deps = [
79    "bounds_checking_function:libsec_shared",
80    "init:libbeget_proxy",
81    "init:libbegetutil",
82  ]
83
84  if (defined(ohos_lite)) {
85    external_deps += [ "hilog_lite:hilog_lite" ]
86  } else {
87    external_deps += [ "hilog:libhilog" ]
88  }
89
90  part_name = "hitrace"
91  subsystem_name = "hiviewdfx"
92}
93
94config("hitrace_dump_config") {
95  visibility = [ ":*" ]
96  include_dirs = [ "include" ]
97}
98
99ohos_shared_library("hitrace_dump") {
100  include_dirs = [
101    "include",
102    "$hitrace_cmd_path/include",
103    "$hitrace_frameworks_path/include",
104  ]
105  public_configs = [ ":hitrace_dump_config" ]
106  sources = [
107    "$hitrace_cmd_path/src/hitrace_osal.cpp",
108    "$hitrace_frameworks_path/native/common_utils.cpp",
109    "$hitrace_frameworks_path/native/dynamic_buffer.cpp",
110    "src/hitrace_dump.cpp",
111  ]
112
113  if (hitrace_double_tracebuffer_size) {
114    defines = [ "DOUBLE_TRACEBUFFER_ENABLE" ]
115  }
116
117  deps = [ "$hitrace_config_path:hitrace_utils" ]
118
119  external_deps = [
120    "bounds_checking_function:libsec_shared",
121    "cJSON:cjson",
122    "init:libbeget_proxy",
123    "init:libbegetutil",
124  ]
125
126  if (defined(ohos_lite)) {
127    external_deps += [ "hilog_lite:hilog_lite" ]
128  } else {
129    external_deps += [ "hilog:libhilog" ]
130  }
131  version_script = "hitrace.map"
132  innerapi_tags = [ "platformsdk" ]
133  part_name = "hitrace"
134  subsystem_name = "hiviewdfx"
135}
136
137ohos_shared_library("hitrace_meter") {
138  branch_protector_ret = "pac_ret"
139  public_configs = [ ":hitrace_meter_config" ]
140  deps = [
141    ":hitrace_etc",
142    ":hitrace_inner",
143    ":libhitracechain",
144  ]
145
146  external_deps = [ "bounds_checking_function:libsec_shared" ]
147  if (defined(ohos_lite)) {
148    external_deps += [ "hilog_lite:hilog_lite" ]
149  } else {
150    external_deps += [ "hilog:libhilog" ]
151  }
152  version_script = "hitrace.map"
153  output_extension = "so"
154
155  innerapi_tags = [
156    "chipsetsdk",
157    "platformsdk",
158    "sasdk",
159  ]
160  part_name = "hitrace"
161  install_images = [
162    "system",
163    "updater",
164  ]
165  subsystem_name = "hiviewdfx"
166}
167
168ohos_prebuilt_etc("hitrace.para") {
169  source = "hitrace.para"
170  install_images = [
171    "system",
172    "updater",
173  ]
174  module_install_dir = "etc/param"
175  part_name = "hitrace"
176  subsystem_name = "hiviewdfx"
177}
178
179ohos_prebuilt_etc("hitrace.para.dac") {
180  source = "hitrace.para.dac"
181  install_images = [
182    "system",
183    "updater",
184  ]
185  module_install_dir = "etc/param"
186  part_name = "hitrace"
187  subsystem_name = "hiviewdfx"
188}
189
190group("hitrace_etc") {
191  deps = [
192    ":hitrace.para",
193    ":hitrace.para.dac",
194  ]
195}
196