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/services/dbinder/c" 18 19config("ipc_rpc_interface") { 20 include_dirs = [ 21 "$SUBSYSTEM_DIR/interfaces/innerkits/c/ipc/include", 22 "$SUBSYSTEM_DIR/interfaces/innerkits/c/dbinder/include", 23 ] 24} 25if (ohos_kernel_type == "linux") { 26 SYSTEM_LEVEL = "small" 27 shared_library("dbinder") { 28 sources = [ 29 "$DBINDER_ROOT/ipc_adapter/${SYSTEM_LEVEL}/dbinder_ipc_adapter.c", 30 "$DBINDER_ROOT/src/dbinder_service.c", 31 "$DBINDER_ROOT/src/dbinder_stub.c", 32 "$DBINDER_ROOT/src/dbinder_trans_callback.c", 33 "$SUBSYSTEM_DIR/utils/src/rpc_session_handle.c", 34 ] 35 public_configs = [ ":ipc_rpc_interface" ] 36 include_dirs = [ 37 "$DBINDER_ROOT/include", 38 "$DBINDER_ROOT/ipc_adapter/include", 39 "$SUBSYSTEM_DIR/ipc/native/c/ipc/include", 40 "$SUBSYSTEM_DIR/ipc/native/c/rpc/include", 41 "$SUBSYSTEM_DIR/ipc/native/c/rpc/ipc_adapter/include", 42 "$SUBSYSTEM_DIR/ipc/native/c/rpc/trans_adapter/include", 43 "$SUBSYSTEM_DIR/ipc/native/c/manager/include", 44 "$SUBSYSTEM_DIR/utils/include", 45 "//third_party/bounds_checking_function/include", 46 "//commonlibrary/utils_lite/include", 47 ] 48 ldflags = [ 49 "-lstdc++", 50 "-lpthread", 51 ] 52 public_deps = [ 53 "$SUBSYSTEM_DIR/interfaces/innerkits/c/ipc:rpc_log", 54 "//third_party/bounds_checking_function/:libsec_shared", 55 ] 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 "//commonlibrary/utils_lite/include", 80 "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite", 81 ] 82 ldflags = [ "-lpthread" ] 83 deps = [ "//foundation/communication/ipc/ipc/native/c/adapter:rpc_adapter" ] 84 } 85} 86