1# Copyright (C) 2021-2023 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"
18DBINDER_ROOT = "$SUBSYSTEM_DIR/services/dbinder"
19
20config("libdbinder_config") {
21  visibility = [ ":*" ]
22  cflags = []
23  if (is_standard_system) {
24    cflags += [ "-DCONFIG_STANDARD_SYSTEM" ]
25  }
26  include_dirs = [
27    "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include",
28    "$SUBSYSTEM_DIR/interfaces/innerkits/libdbinder/include",
29    "$DBINDER_ROOT/dbinder_service/include",
30  ]
31}
32
33config("libdbinder_private_config") {
34  visibility = [ ":*" ]
35  cflags_cc = [
36    "-DLOG_TAG=\"libdbinder\"",
37    "-O2",
38  ]
39}
40
41ohos_shared_library("libdbinder") {
42  sanitize = {
43    integer_overflow = true
44  }
45  branch_protector_ret = "pac_ret"
46  include_dirs = [
47    "$SUBSYSTEM_DIR/ipc/native/c/rpc/include",
48    "$SUBSYSTEM_DIR/utils/include",
49  ]
50  sources = [
51    "$DBINDER_ROOT/dbinder_service/src/dbinder_death_recipient.cpp",
52    "$DBINDER_ROOT/dbinder_service/src/dbinder_sa_death_recipient.cpp",
53    "$DBINDER_ROOT/dbinder_service/src/dbinder_service.cpp",
54    "$DBINDER_ROOT/dbinder_service/src/dbinder_service_stub.cpp",
55    "$DBINDER_ROOT/dbinder_service/src/socket/dbinder_remote_listener.cpp",
56  ]
57
58  public_configs = [
59    ":libdbinder_config",
60    "$SUBSYSTEM_DIR/config:dsoftbus_header_deps_config",
61  ]
62
63  configs = [ ":libdbinder_private_config" ]
64  deps = [
65    "$IPC_CORE_ROOT/src/core:ipc_common",
66    "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core:ipc_core",
67  ]
68
69  external_deps = [
70    "c_utils:utils",
71    "ffrt:libffrt",
72    "hilog:libhilog",
73    "hisysevent:libhisysevent",
74  ]
75  subsystem_name = "communication"
76  part_name = "ipc"
77}
78