1# Copyright (c) 2021 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")
15if (support_jsapi) {
16  SUBSYSTEM_DIR = "//foundation/communication/ipc"
17
18  config("rpc_public_config") {
19    visibility = [ ":*" ]
20    include_dirs = [ "$SUBSYSTEM_DIR/ipc/native/src/napi/include" ]
21  }
22
23  ohos_shared_library("rpc") {
24    sanitize = {
25      integer_overflow = true
26    }
27    version_script = "librpc_map"
28    branch_protector_ret = "pac_ret"
29    include_dirs = [
30      "$SUBSYSTEM_DIR/utils/include",
31      "$SUBSYSTEM_DIR/ipc/native/c/adapter/include",
32      "$SUBSYSTEM_DIR/ipc/native/c/adapter/access_token/include",
33      "$SUBSYSTEM_DIR/ipc/native/src/napi_common/include",
34    ]
35    public_configs = [ ":rpc_public_config" ]
36
37    sources = [
38      "$SUBSYSTEM_DIR/ipc/native/src/napi/src/napi_ipc_skeleton.cpp",
39      "$SUBSYSTEM_DIR/ipc/native/src/napi/src/napi_message_option.cpp",
40      "$SUBSYSTEM_DIR/ipc/native/src/napi/src/napi_remote_proxy.cpp",
41      "$SUBSYSTEM_DIR/ipc/native/src/napi/src/napi_rpc_native_module.cpp",
42    ]
43
44    deps = [
45      "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core:ipc_core",
46      "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_napi_common:ipc_napi",
47    ]
48
49    external_deps = [
50      "c_utils:utils",
51      "hilog:libhilog",
52      "hitrace:hitrace_meter",
53      "libuv:uv",
54      "napi:ace_napi",
55    ]
56
57    relative_install_dir = "module"
58
59    subsystem_name = "communication"
60    part_name = "ipc"
61  }
62} else {
63  ohos_shared_library("rpc") {
64  }
65}
66