1# Copyright (c) Huawei Technologies Co., Ltd. 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
17config("ffrt_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "include",
21    "${OHOS_PROFILER_DIR}/device/plugins/ffrt_profiler/service/include",
22    "${OHOS_PROFILER_DIR}/device/services/ipc/include",
23    "${OHOS_PROFILER_DIR}/device/services/shared_memory/include",
24    "${OHOS_PROFILER_DIR}/interfaces/kits",
25    "${OHOS_PROFILER_DIR}/device/plugins/api/include",
26    "${OHOS_PROFILER_DIR}/device/base/include",
27  ]
28  defines = [
29    "NO_PROTOBUF",
30    "HAVE_HILOG",
31  ]
32}
33
34ohos_shared_library("libffrt_profiler") {
35  output_name = "libffrt_profiler"
36  public_configs = [ ":ffrt_config" ]
37
38  sources = [
39    "src/ffrt_profiler.cpp",
40    "src/ffrt_profiler_socker_client.cpp",
41    "src/ffrt_profiler_write.cpp",
42  ]
43
44  sources += [
45    "${OHOS_PROFILER_DIR}/device/base/src/epoll_event_poller.cpp",
46    "${OHOS_PROFILER_DIR}/device/base/src/event_notifier.cpp",
47    "${OHOS_PROFILER_DIR}/device/plugins/ffrt_profiler/service/src/ffrt_profiler_common.cpp",
48    "${OHOS_PROFILER_DIR}/device/services/ipc/src/client_connection.cpp",
49    "${OHOS_PROFILER_DIR}/device/services/ipc/src/service_entry.cpp",
50    "${OHOS_PROFILER_DIR}/device/services/ipc/src/socket_context.cpp",
51    "${OHOS_PROFILER_DIR}/device/services/ipc/src/unix_socket_client.cpp",
52    "${OHOS_PROFILER_DIR}/device/services/ipc/src/unix_socket_server.cpp",
53  ]
54
55  deps = [
56    "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_lite",
57  ]
58
59  external_deps = [
60    "bounds_checking_function:libsec_shared",
61    "init:libbegetutil",
62  ]
63
64  defines = []
65  if (current_toolchain != host_toolchain) {
66    external_deps += [ "hilog:libhilog_base" ]
67  }
68
69  install_images = [
70    "system",
71    "updater",
72  ]
73
74  innerapi_tags = [ "chipsetsdk" ]
75
76  install_enable = true
77  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
78  part_name = "${OHOS_PROFILER_PART_NAME}"
79}
80