# Copyright (C) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") SUBSYSTEM_DIR = "//foundation/communication/ipc" IPC_CORE_ROOT = "$SUBSYSTEM_DIR/ipc/native" ohos_rust_shared_library("ipc_rust") { sources = [ "src/errors.rs", "src/ipc/macros.rs", "src/ipc/mod.rs", "src/ipc/remote_obj.rs", "src/ipc/remote_stub.rs", "src/ipc_binding.rs", "src/lib.rs", "src/parcel/mod.rs", "src/parcel/parcelable.rs", "src/parcel/types.rs", ] deps = [ ":ipc_c", "//base/hiviewdfx/hilog/interfaces/rust:hilog_rust", ] crate_name = "ipc_rust" crate_type = "dylib" install_images = [ system_base_dir ] subsystem_name = "communication" part_name = "ipc" } config("libipc_c_private_config") { cflags_cc = [ "-O2" ] } ohos_shared_library("ipc_c") { sanitize = { integer_overflow = true } include_dirs = [ "$IPC_CORE_ROOT/src/c_wrapper/include", "$SUBSYSTEM_DIR/utils/include", ] sources = [ "$IPC_CORE_ROOT/src/c_wrapper/source/c_ashmem.cpp", "$IPC_CORE_ROOT/src/c_wrapper/source/c_parcel.cpp", "$IPC_CORE_ROOT/src/c_wrapper/source/c_process.cpp", "$IPC_CORE_ROOT/src/c_wrapper/source/c_remote_object.cpp", ] configs = [ ":libipc_c_private_config" ] deps = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_single:ipc_single" ] external_deps = [ "c_utils:utils", "hiviewdfx_hilog_native:libhilog", ] output_extension = "so" install_images = [ system_base_dir ] subsystem_name = "communication" part_name = "ipc" } group("rust_ipc_component") { deps = [ ":ipc_rust" ] }