1# Copyright (C) 2022 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") 15 16SUBSYSTEM_DIR = "//foundation/communication/ipc" 17IPC_CORE_ROOT = "$SUBSYSTEM_DIR/ipc/native" 18 19ohos_rust_shared_library("ipc_rust") { 20 crate_name = "ipc_rust" 21 edition = "2021" 22 23 sources = [ "src/lib.rs" ] 24 25 deps = [ ":ipc_c" ] 26 27 external_deps = [ 28 "hilog:hilog_rust", 29 "ylong_runtime:ylong_runtime", 30 ] 31 32 install_images = [ system_base_dir ] 33 subsystem_name = "communication" 34 part_name = "ipc" 35} 36 37config("libipc_c_private_config") { 38 cflags_cc = [ 39 "-DCONFIG_IPC_SINGLE", 40 "-O2", 41 ] 42} 43 44ohos_shared_library("ipc_c") { 45 sanitize = { 46 integer_overflow = true 47 } 48 include_dirs = [ 49 "$IPC_CORE_ROOT/src/c_wrapper/include", 50 "$SUBSYSTEM_DIR/utils/include", 51 ] 52 sources = [ 53 "$IPC_CORE_ROOT/src/c_wrapper/source/c_ashmem.cpp", 54 "$IPC_CORE_ROOT/src/c_wrapper/source/c_parcel.cpp", 55 "$IPC_CORE_ROOT/src/c_wrapper/source/c_process.cpp", 56 "$IPC_CORE_ROOT/src/c_wrapper/source/c_remote_object.cpp", 57 ] 58 59 configs = [ ":libipc_c_private_config" ] 60 61 deps = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_single:ipc_single" ] 62 63 external_deps = [ 64 "c_utils:utils", 65 "hilog:libhilog", 66 ] 67 68 output_extension = "so" 69 install_images = [ system_base_dir ] 70 subsystem_name = "communication" 71 part_name = "ipc" 72} 73 74group("rust_ipc_component") { 75 deps = [ ":ipc_rust" ] 76} 77