1# Copyright (c) Huawei Technologies Co., Ltd. 2021-2023. 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.
13
14import("//build/ohos.gni")
15import("../../base/config.gni")
16
17ohos_source_set("ipc") {
18  part_name = "${OHOS_PROFILER_PART_NAME}"
19  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
20  sources = [
21    "src/client_connection.cpp",
22    "src/client_map.cpp",
23    "src/service_entry.cpp",
24    "src/socket_context.cpp",
25    "src/unix_socket_client.cpp",
26    "src/unix_socket_server.cpp",
27  ]
28  include_dirs = [
29    "include",
30    "../../base/include",
31  ]
32
33  external_deps = [
34    "bounds_checking_function:libsec_shared",
35    "init:libbegetutil",
36    "protobuf:protobuf_lite_static",
37    "protobuf:protobuf_static",
38  ]
39
40  if (current_toolchain != host_toolchain) {
41    defines = [ "HAVE_HILOG" ]
42    external_deps += [ "hilog:libhilog_base" ]
43  }
44  public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
45}
46
47ohos_executable("protoc_gen_ipc") {
48  sources = [
49    "src/ipc_generator.cpp",
50    "src/ipc_generator_impl.cpp",
51    "src/main.cpp",
52  ]
53
54  include_dirs = [ "include" ]
55  public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
56  external_deps = [
57    "protobuf:protobuf_lite_static",
58    "protobuf:protobuf_static",
59    "protobuf:protoc_static_lib(${host_toolchain})",
60  ]
61  install_enable = false
62  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
63  part_name = "${OHOS_PROFILER_PART_NAME}"
64}
65
66ohos_executable("protoencoder_plugin") {
67  sources = [
68    "src/proto_encoder_plugin.cpp",
69    "src/proto_encoder_plugin_generator.cpp",
70  ]
71
72  include_dirs = [ "include" ]
73  public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
74  external_deps = [
75    "protobuf:protobuf_lite_static",
76    "protobuf:protobuf_static",
77    "protobuf:protoc_static_lib(${host_toolchain})",
78  ]
79  install_enable = false
80  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
81  part_name = "${OHOS_PROFILER_PART_NAME}"
82}
83