• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2025 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("//build/ohos.gni")
15import("../config.gni")
16
17SUBSYSTEM_DIR = "../"
18IPC_CORE_ROOT = "$SUBSYSTEM_DIR/ipc/native"
19
20config("libipc_common_static_private_config") {
21  cflags_cc = [ "-O2" ]
22}
23
24config("libipc_single_static_private_config") {
25  cflags_cc = [ "-O2" ]
26}
27
28config("ipc_single_static_config") {
29  include_dirs = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include" ]
30  if (current_os == "ohos") {
31    defines = [ "OHOS_PLATFORM" ]
32  }
33}
34
35ohos_static_library("ipc_common_test_static") {
36  sanitize = {
37    integer_overflow = true
38  }
39  branch_protector_ret = "pac_ret"
40  include_dirs = [
41    "$IPC_CORE_ROOT/src/core/dbinder/include",
42    "$IPC_CORE_ROOT/src/core/framework/include",
43    "$IPC_CORE_ROOT/src/core/invoker/include",
44    "$SUBSYSTEM_DIR/utils/include",
45    "include",
46  ]
47
48  sources = [
49    "$IPC_CORE_ROOT/src/core/framework/source/ipc_payload_statistics_impl.cpp",
50    "$IPC_CORE_ROOT/src/core/framework/source/process_skeleton.cpp",
51    "$IPC_CORE_ROOT/src/core/invoker/source/binder_connector.cpp",
52  ]
53
54  configs = [
55    "$SUBSYSTEM_DIR/config:dsoftbus_header_deps_config",
56    "$SUBSYSTEM_DIR/config:ipc_util_config",
57    ":libipc_common_static_private_config",
58  ]
59
60  external_deps = [
61    "c_utils:utils",
62    "hilog:libhilog",
63  ]
64
65  if (hiviewdfx_hisysevent_support) {
66    external_deps += [ "hisysevent:libhisysevent" ]
67  }
68
69  defines = [ "FFRT_IPC_ENABLE" ]
70
71  subsystem_name = "communication"
72  part_name = "ipc"
73}
74
75ohos_static_library("ipc_single_test_static") {
76  sanitize = {
77    integer_overflow = true
78  }
79
80  branch_protector_ret = "pac_ret"
81  include_dirs = [
82    "$IPC_CORE_ROOT/c/adapter/access_token/include",
83    "$IPC_CORE_ROOT/c/rpc/include",
84    "$SUBSYSTEM_DIR/utils/include",
85  ]
86
87  sources = [
88    "$IPC_CORE_ROOT/c/adapter/access_token/src/access_token_adapter.c",
89    "$IPC_CORE_ROOT/c/rpc/src/rpc_feature_set.c",
90    "$IPC_CORE_ROOT/src/core/dbinder/source/databus_socket_listener.cpp",
91    "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_callback_stub.cpp",
92    "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_databus_invoker.cpp",
93    "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_session_object.cpp",
94    "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_softbus_client.cpp",
95    "$IPC_CORE_ROOT/src/core/framework/source/binder_debug.cpp",
96    "$IPC_CORE_ROOT/src/core/framework/source/buffer_object.cpp",
97    "$IPC_CORE_ROOT/src/core/framework/source/comm_auth_info.cpp",
98    "$IPC_CORE_ROOT/src/core/framework/source/ipc_file_descriptor.cpp",
99    "$IPC_CORE_ROOT/src/core/framework/source/ipc_object_proxy.cpp",
100    "$IPC_CORE_ROOT/src/core/framework/source/ipc_object_stub.cpp",
101    "$IPC_CORE_ROOT/src/core/framework/source/ipc_payload_statistics.cpp",
102    "$IPC_CORE_ROOT/src/core/framework/source/ipc_process_skeleton.cpp",
103    "$IPC_CORE_ROOT/src/core/framework/source/ipc_skeleton.cpp",
104    "$IPC_CORE_ROOT/src/core/framework/source/ipc_thread_pool.cpp",
105    "$IPC_CORE_ROOT/src/core/framework/source/ipc_thread_skeleton.cpp",
106    "$IPC_CORE_ROOT/src/core/framework/source/ipc_workthread.cpp",
107    "$IPC_CORE_ROOT/src/core/framework/source/iremote_broker.cpp",
108    "$IPC_CORE_ROOT/src/core/framework/source/iremote_object.cpp",
109    "$IPC_CORE_ROOT/src/core/framework/source/message_option.cpp",
110    "$IPC_CORE_ROOT/src/core/framework/source/message_parcel.cpp",
111    "$IPC_CORE_ROOT/src/core/framework/source/peer_holder.cpp",
112    "$IPC_CORE_ROOT/src/core/framework/source/stub_refcount_object.cpp",
113    "$IPC_CORE_ROOT/src/core/invoker/source/binder_invoker.cpp",
114    "$IPC_CORE_ROOT/src/core/invoker/source/hitrace_invoker.cpp",
115    "$IPC_CORE_ROOT/src/core/invoker/source/invoker_factory.cpp",
116    "$IPC_CORE_ROOT/src/core/invoker/source/invoker_rawdata.cpp",
117  ]
118
119  configs = [
120    "$SUBSYSTEM_DIR/config:ipc_util_config",
121    ":libipc_single_static_private_config",
122  ]
123  public_configs = [
124    "$SUBSYSTEM_DIR/config:dsoftbus_header_deps_config",
125    "$SUBSYSTEM_DIR/config:ipc_util_config",
126    ":ipc_single_static_config",
127  ]
128
129  deps = [ ":ipc_common_test_static" ]
130  external_deps = [
131    "c_utils:utils",
132    "faultloggerd:libbacktrace_local",
133    "ffrt:libffrt",
134    "hilog:libhilog",
135    "hitrace:libhitracechain",
136    "selinux:libselinux",
137  ]
138
139  if (hiviewdfx_hisysevent_support) {
140    external_deps += [ "hisysevent:libhisysevent" ]
141  }
142
143  defines = [ "FFRT_IPC_ENABLE" ]
144  if (build_selinux) {
145    defines += [ "WITH_SELINUX" ]
146  }
147  if (ipc_feature_trace_enabled) {
148    defines += [ "ENABLE_IPC_TRACE" ]
149    sources += [ "$IPC_CORE_ROOT/src/core/framework/source/ipc_trace.cpp" ]
150  }
151
152  subsystem_name = "communication"
153  part_name = "ipc"
154}
155