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("hiperfplugin_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_source_set("hiperfplugin_source") {
27  output_name = "hiperfplugin"
28  sources = [
29    "${OHOS_PROFILER_DIR}/device/services/profiler_service/src/trace_file_helper.cpp",
30    "${OHOS_PROFILER_DIR}/device/services/profiler_service/src/trace_file_writer.cpp",
31    "src/hiperf_module.cpp",
32  ]
33  public_configs = [
34    ":hiperfplugin_config",
35    "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config",
36  ]
37  public_deps = [
38    "${OHOS_PROFILER_DIR}/protos/services:common_types_lite_proto",
39    "${OHOS_PROFILER_DIR}/protos/types/plugins/hiperf_data:hiperf_data_cpp",
40    "../../base:hiprofiler_base",
41  ]
42  if (current_toolchain != host_toolchain) {
43    defines = [
44      "HAVE_HILOG",
45      "LITE_PROTO",
46    ]
47    external_deps = [
48      "bounds_checking_function:libsec_shared",
49      "hilog:libhilog_base",
50      "openssl:libcrypto_shared",
51      "protobuf:protobuf_lite",
52    ]
53  }
54  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
55  part_name = "${OHOS_PROFILER_PART_NAME}"
56}
57
58ohos_shared_library("hiperfplugin") {
59  deps = [ ":hiperfplugin_source" ]
60  version_script = "libhiperf_plugin.map"
61  if (current_toolchain != host_toolchain) {
62    defines = [
63      "HAVE_HILOG",
64      "LITE_PROTO",
65    ]
66    external_deps = [ "hilog:libhilog_base" ]
67  }
68  install_enable = true
69  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
70  part_name = "${OHOS_PROFILER_PART_NAME}"
71}
72