1# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
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.
13import("//build/ohos.gni")
14import("../../base/config.gni")
15
16config("bytraceplugin_config") {
17  include_dirs = [
18    "../api/include",
19    "${OHOS_PROFILER_DIR}/interfaces/kits",
20    "../../services/profiler_service/src",
21    "../../base/include",
22    "include",
23  ]
24}
25
26ohos_shared_library("bytraceplugin") {
27  output_name = "bytraceplugin"
28  sources = [ "src/bytrace_module.cpp" ]
29  public_configs = [
30    ":bytraceplugin_config",
31    "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config",
32  ]
33  public_deps = [ "${OHOS_PROFILER_DIR}/protos/types/plugins/bytrace_plugin:bytrace_plugin_protos_cpp" ]
34  if (current_toolchain != host_toolchain) {
35    defines = [ "HAVE_HILOG" ]
36    external_deps = [
37      "bounds_checking_function:libsec_shared",
38      "hilog:libhilog_base",
39      "protobuf:protobuf_lite",
40    ]
41  }
42  install_enable = false
43  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
44  part_name = "${OHOS_PROFILER_PART_NAME}"
45}
46
47ohos_executable("test_bytrace_plugin") {
48  output_name = "test_bytraceplugin"
49  sources = [ "src/run_test.cpp" ]
50  deps = [ ":bytraceplugin" ]
51  install_enable = false
52  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
53  part_name = "${OHOS_PROFILER_PART_NAME}"
54}
55