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")
15import("./../uhdf.gni")
16
17hdf_framework_path = "./../../../framework"
18hdf_interface_path = "./../../../interfaces"
19
20config("libhdf_ipc_adapter_pub_config") {
21  visibility = [ ":*" ]
22
23  include_dirs = [
24    "$hdf_interface_path/inner_api/ipc",
25    "$hdf_interface_path/inner_api/core",
26    "$hdf_uhdf_path/utils/include",
27  ]
28}
29if (defined(ohos_lite)) {
30  group("libhdf_ipc_adapter") {
31    deps = []
32  }
33} else {
34  ohos_shared_library("libhdf_ipc_adapter") {
35    branch_protector_ret = "pac_ret"
36    include_dirs = [
37      "include",
38      "$hdf_framework_path/utils/include",
39      "$hdf_framework_path/core/shared/include",
40    ]
41
42    public_configs = [ ":libhdf_ipc_adapter_pub_config" ]
43
44    sources = [
45      "src/hdf_dump.cpp",
46      "src/hdf_remote_adapter.cpp",
47      "src/hdf_remote_service.c",
48      "src/hdf_sbuf_impl_hipc.cpp",
49    ]
50
51    if (is_standard_system) {
52      deps = [ "../pub_utils:libpub_utils" ]
53      external_deps = [
54        "c_utils:utils",
55        "hilog:libhilog",
56        "ipc:ipc_single",
57        "samgr:samgr_proxy",
58      ]
59    } else {
60      external_deps = [
61        "hilog:libhilog",
62        "ipc:ipc_single",
63        "samgr:samgr_proxy",
64      ]
65    }
66
67    if (build_selinux) {
68      cflags = [ "-DWITH_SELINUX" ]
69    }
70
71    innerapi_tags = [
72      "chipsetsdk",
73      "platformsdk_indirect",
74    ]
75    install_images = [
76      system_base_dir,
77      updater_base_dir,
78    ]
79    subsystem_name = "hdf"
80    part_name = "hdf_core"
81  }
82}
83