1# Copyright (C) 2021-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 = "//foundation/communication/ipc" 18IPC_CORE_ROOT = "$SUBSYSTEM_DIR/ipc/native" 19 20config("libipc_single_private_config") { 21 cflags_cc = [ "-O2" ] 22} 23 24config("ipc_all_deps_config") { 25 include_dirs = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include" ] 26 if (current_os == "ohos") { 27 defines = [ "OHOS_PLATFORM" ] 28 } 29} 30 31common_include = [ 32 "$IPC_CORE_ROOT/c/adapter/access_token/include", 33 "$IPC_CORE_ROOT/c/rpc/include", 34 "$SUBSYSTEM_DIR/utils/include", 35] 36 37common_source = [ 38 "$IPC_CORE_ROOT/c/adapter/access_token/src/access_token_adapter.c", 39 "$IPC_CORE_ROOT/c/rpc/src/rpc_feature_set.c", 40 "$IPC_CORE_ROOT/src/core/dbinder/source/databus_socket_listener.cpp", 41 "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_callback_stub.cpp", 42 "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_databus_invoker.cpp", 43 "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_session_object.cpp", 44 "$IPC_CORE_ROOT/src/core/dbinder/source/dbinder_softbus_client.cpp", 45 "$IPC_CORE_ROOT/src/core/framework/source/binder_debug.cpp", 46 "$IPC_CORE_ROOT/src/core/framework/source/buffer_object.cpp", 47 "$IPC_CORE_ROOT/src/core/framework/source/comm_auth_info.cpp", 48 "$IPC_CORE_ROOT/src/core/framework/source/ipc_file_descriptor.cpp", 49 "$IPC_CORE_ROOT/src/core/framework/source/ipc_object_proxy.cpp", 50 "$IPC_CORE_ROOT/src/core/framework/source/ipc_object_stub.cpp", 51 "$IPC_CORE_ROOT/src/core/framework/source/ipc_payload_statistics.cpp", 52 "$IPC_CORE_ROOT/src/core/framework/source/ipc_process_skeleton.cpp", 53 "$IPC_CORE_ROOT/src/core/framework/source/ipc_skeleton.cpp", 54 "$IPC_CORE_ROOT/src/core/framework/source/ipc_thread_pool.cpp", 55 "$IPC_CORE_ROOT/src/core/framework/source/ipc_thread_skeleton.cpp", 56 "$IPC_CORE_ROOT/src/core/framework/source/ipc_workthread.cpp", 57 "$IPC_CORE_ROOT/src/core/framework/source/iremote_broker.cpp", 58 "$IPC_CORE_ROOT/src/core/framework/source/iremote_object.cpp", 59 "$IPC_CORE_ROOT/src/core/framework/source/message_option.cpp", 60 "$IPC_CORE_ROOT/src/core/framework/source/message_parcel.cpp", 61 "$IPC_CORE_ROOT/src/core/framework/source/peer_holder.cpp", 62 "$IPC_CORE_ROOT/src/core/framework/source/stub_refcount_object.cpp", 63 "$IPC_CORE_ROOT/src/core/invoker/source/binder_invoker.cpp", 64 "$IPC_CORE_ROOT/src/core/invoker/source/hitrace_invoker.cpp", 65 "$IPC_CORE_ROOT/src/core/invoker/source/invoker_factory.cpp", 66 "$IPC_CORE_ROOT/src/core/invoker/source/invoker_rawdata.cpp", 67] 68 69common_configs = [ 70 "$SUBSYSTEM_DIR/config:ipc_util_config", 71 ":libipc_single_private_config", 72] 73 74common_public_configs = [ 75 "$SUBSYSTEM_DIR/config:dsoftbus_header_deps_config", 76 "$SUBSYSTEM_DIR/config:ipc_util_config", 77 ":ipc_all_deps_config", 78] 79 80common_external_deps = [ 81 "faultloggerd:libbacktrace_local", 82 "ffrt:libffrt", 83 "hilog:libhilog", 84 "hitrace:libhitracechain", 85 "selinux:libselinux", 86] 87 88if (hiviewdfx_hisysevent_support) { 89 common_external_deps += [ "hisysevent:libhisysevent" ] 90} 91 92ohos_shared_library("ipc_single") { 93 sanitize = { 94 integer_overflow = true 95 } 96 version_script = "libipc_single_map" 97 branch_protector_ret = "pac_ret" 98 include_dirs = common_include 99 100 sources = common_source 101 102 configs = common_configs 103 public_configs = common_public_configs 104 all_dependent_configs = [ ":ipc_all_deps_config" ] 105 106 deps = [ "$IPC_CORE_ROOT/src/core:ipc_common" ] 107 108 public_external_deps = [ "c_utils:utils" ] 109 110 external_deps = common_external_deps 111 defines = [ "FFRT_IPC_ENABLE" ] 112 if (build_selinux) { 113 defines += [ "WITH_SELINUX" ] 114 } 115 if (ipc_feature_trace_enabled) { 116 defines += [ "ENABLE_IPC_TRACE" ] 117 sources += [ "$IPC_CORE_ROOT/src/core/framework/source/ipc_trace.cpp" ] 118 } 119 if (ipc_proxy_dfx_backtrace_enabled) { 120 defines += [ "ENABLE_IPC_PROXY_DFX_BACKTRACE" ] 121 } 122 if (hiviewdfx_hisysevent_support) { 123 defines += [ "HIVIEWDFX_HISYSEVENT_SUPPORT" ] 124 } 125 innerapi_tags = [ 126 "chipsetsdk", 127 "platformsdk", 128 "sasdk", 129 ] 130 131 install_images = [ 132 system_base_dir, 133 updater_base_dir, 134 ] 135 install_enable = false 136 subsystem_name = "communication" 137 part_name = "ipc" 138} 139 140ohos_shared_library("ipc_single_test") { 141 sanitize = { 142 integer_overflow = true 143 } 144 145 branch_protector_ret = "pac_ret" 146 include_dirs = common_include 147 148 sources = common_source 149 150 configs = common_configs 151 public_configs = common_public_configs 152 153 deps = [ "$IPC_CORE_ROOT/src/core:ipc_common" ] 154 external_deps = common_external_deps 155 external_deps += [ "c_utils:utils" ] 156 defines = [ "FFRT_IPC_ENABLE" ] 157 if (build_selinux) { 158 defines += [ "WITH_SELINUX" ] 159 } 160 if (ipc_feature_trace_enabled) { 161 defines += [ "ENABLE_IPC_TRACE" ] 162 sources += [ "$IPC_CORE_ROOT/src/core/framework/source/ipc_trace.cpp" ] 163 } 164 if (hiviewdfx_hisysevent_support) { 165 defines += [ "HIVIEWDFX_HISYSEVENT_SUPPORT" ] 166 } 167 innerapi_tags = [ 168 "chipsetsdk_sp", 169 "platformsdk", 170 "sasdk", 171 ] 172 173 install_images = [ 174 system_base_dir, 175 updater_base_dir, 176 ] 177 install_enable = false 178 subsystem_name = "communication" 179 part_name = "ipc" 180} 181