• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020 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/lite/config/component/lite_component.gni")
15
16SUBSYSTEM_DIR = "//foundation/communication/ipc"
17DBINDER_ROOT = "$SUBSYSTEM_DIR/dbinder/c"
18IPC_CORE_ROOT = "$SUBSYSTEM_DIR/ipc/native"
19
20config("ipc_rpc_interface") {
21  include_dirs = [
22    "$SUBSYSTEM_DIR/interfaces/innerkits/c/ipc/include",
23    "$SUBSYSTEM_DIR/interfaces/innerkits/c/dbinder/include",
24  ]
25}
26if (ohos_kernel_type == "linux") {
27  SYSTEM_LEVEL = "small"
28  shared_library("dbinder") {
29    sources = [
30      "$DBINDER_ROOT/ipc_adapter/${SYSTEM_LEVEL}/dbinder_ipc_adapter.c",
31      "$DBINDER_ROOT/src/dbinder_service.c",
32      "$DBINDER_ROOT/src/dbinder_stub.c",
33      "$DBINDER_ROOT/src/dbinder_trans_callback.c",
34      "$SUBSYSTEM_DIR/utils/src/rpc_session_handle.c",
35    ]
36    public_configs = [ ":ipc_rpc_interface" ]
37    include_dirs = [
38      "$DBINDER_ROOT/include",
39      "$DBINDER_ROOT/ipc_adapter/include",
40      "$IPC_CORE_ROOT/c/ipc/include",
41      "$IPC_CORE_ROOT/c/rpc/include",
42      "$IPC_CORE_ROOT/c/rpc/ipc_adapter/include",
43      "$IPC_CORE_ROOT/c/rpc/trans_adapter/include",
44      "$IPC_CORE_ROOT/c/manager/include",
45      "$SUBSYSTEM_DIR/utils/include",
46    ]
47    ldflags = [
48      "-lstdc++",
49      "-lpthread",
50    ]
51    public_deps = [
52      "$SUBSYSTEM_DIR/interfaces/innerkits/c/ipc:rpc_log",
53      "//third_party/bounds_checking_function/:libsec_shared",
54    ]
55    external_deps = [ "bounds_checking_function:libsec_shared" ]
56  }
57} else if (ohos_kernel_type == "liteos_m") {
58  SYSTEM_LEVEL = "mini"
59  static_library("dbinder") {
60    sources = [
61      "$DBINDER_ROOT/ipc_adapter/${SYSTEM_LEVEL}/dbinder_ipc_adapter.c",
62      "$DBINDER_ROOT/src/dbinder_service.c",
63      "$DBINDER_ROOT/src/dbinder_stub.c",
64      "$DBINDER_ROOT/src/dbinder_trans_callback.c",
65      "$SUBSYSTEM_DIR/utils/src/rpc_session_handle.c",
66    ]
67    public_configs = [ ":ipc_rpc_interface" ]
68    include_dirs = [
69      "$DBINDER_ROOT/include",
70      "$DBINDER_ROOT/ipc_adapter/include",
71      "$SUBSYSTEM_DIR/ipc/native/c/ipc/include",
72      "$SUBSYSTEM_DIR/ipc/native/c/rpc/include",
73      "$SUBSYSTEM_DIR/ipc/native/c/rpc/ipc_adapter/include",
74      "$SUBSYSTEM_DIR/ipc/native/c/rpc/trans_adapter/include",
75      "$SUBSYSTEM_DIR/ipc/native/c/manager/include",
76      "$SUBSYSTEM_DIR/ipc/test/rpc/include",
77      "$SUBSYSTEM_DIR/utils/include",
78      "//third_party/bounds_checking_function/include",
79      "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
80    ]
81    ldflags = [ "-lpthread" ]
82    deps = [ "$IPC_CORE_ROOT/c/adapter:rpc_adapter" ]
83  }
84}
85