• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  sources = [
21    "src/errors.rs",
22    "src/ipc/macros.rs",
23    "src/ipc/mod.rs",
24    "src/ipc/remote_obj.rs",
25    "src/ipc/remote_stub.rs",
26    "src/ipc_binding.rs",
27    "src/lib.rs",
28    "src/parcel/mod.rs",
29    "src/parcel/parcelable.rs",
30    "src/parcel/types.rs",
31  ]
32
33  deps = [ ":ipc_c" ]
34
35  external_deps = [ "hilog:hilog_rust" ]
36
37  crate_name = "ipc_rust"
38  crate_type = "dylib"
39
40  install_images = [ system_base_dir ]
41  subsystem_name = "communication"
42  part_name = "ipc"
43}
44
45config("libipc_c_private_config") {
46  cflags_cc = [ "-O2" ]
47}
48
49ohos_shared_library("ipc_c") {
50  sanitize = {
51    integer_overflow = true
52  }
53  include_dirs = [
54    "$IPC_CORE_ROOT/src/c_wrapper/include",
55    "$SUBSYSTEM_DIR/utils/include",
56  ]
57  sources = [
58    "$IPC_CORE_ROOT/src/c_wrapper/source/c_ashmem.cpp",
59    "$IPC_CORE_ROOT/src/c_wrapper/source/c_parcel.cpp",
60    "$IPC_CORE_ROOT/src/c_wrapper/source/c_process.cpp",
61    "$IPC_CORE_ROOT/src/c_wrapper/source/c_remote_object.cpp",
62  ]
63
64  configs = [ ":libipc_c_private_config" ]
65
66  deps = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_single:ipc_single" ]
67
68  external_deps = [
69    "c_utils:utils",
70    "hilog:libhilog",
71  ]
72
73  output_extension = "so"
74  install_images = [ system_base_dir ]
75  subsystem_name = "communication"
76  part_name = "ipc"
77}
78
79group("rust_ipc_component") {
80  deps = [ ":ipc_rust" ]
81}
82