• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("./../../../adapter/uhdf2/uhdf.gni")
16
17group("uhdf_hidl_pkg") {
18  deps = [ ":libhdi" ]
19}
20
21hdf_framework_path = "./../../../framework"
22hdf_interface_path = "./../../../interfaces"
23hdf_uhdf_path = "./.."
24
25config("libhdi_pub_config") {
26  visibility = [ ":*" ]
27
28  include_dirs = [
29    "$hdf_interface_path/inner_api/hdi",
30    "$hdf_interface_path/inner_api/hdi/base",
31    "$hdf_interface_path/inner_api/core",
32  ]
33}
34if (defined(ohos_lite)) {
35  ohos_shared_library("libhdi") {
36    output_extension = "z.so"
37
38    if (target_cpu == "arm64" || target_cpu == "x86_64") {
39      defines = [ "__ARCH64__" ]
40    }
41
42    include_dirs = [
43      "$hdf_interface_path/inner_api/utils",
44      "$hdf_interface_path/inner_api/osal/uhdf",
45    ]
46    all_dependent_configs = [ ":libhdi_pub_config" ]
47    sources = [ "src/hdi_support.cpp" ]
48
49    deps = [
50      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
51      "//third_party/bounds_checking_function:libsec_shared",
52    ]
53
54    defines = [ "__USER__" ]
55
56    # install_images = [ system_base_dir ]
57    subsystem_name = "hdf"
58    part_name = "hdf_core"
59  }
60} else {
61  ohos_shared_library("libhdi") {
62    if (target_cpu == "arm64" || target_cpu == "x86_64") {
63      defines = [ "__ARCH64__" ]
64    }
65
66    include_dirs = [
67      "$hdf_framework_path/core/shared/include",
68      "$hdf_framework_path/core/host/include",
69      "$hdf_framework_path/core/manager/include",
70      "$hdf_framework_path/include/utils",
71      "$hdf_framework_path/include/osal",
72      "$hdf_framework_path/utils/include",
73      "$hdf_framework_path/include/core",
74      "$hdf_uhdf_path/include/devhost",
75      "$hdf_uhdf_path/devhost/include",
76      "$hdf_uhdf_path/devmgr/include",
77      "$hdf_uhdf_path/host/include",
78      "$hdf_uhdf_path/manager/include",
79      "$hdf_uhdf_path/include/hdi",
80      "$hdf_uhdf_path/ipc/include",
81      "$hdf_interface_path/inner_api/ipc",
82      "$hdf_interface_path/inner_api/utils",
83      "$hdf_interface_path/inner_api/host/shared",
84      "$hdf_interface_path/inner_api/host/uhdf",
85    ]
86    public_configs = [ ":libhdi_pub_config" ]
87    sources = [
88      "$hdf_framework_path/core/shared/src/service_status.c",
89      "src/buffer_util.c",
90      "src/devmgr_client.c",
91      "src/hdi_smq_syncer.cpp",
92      "src/hdi_support.cpp",
93      "src/idevmgr_client.cpp",
94      "src/iservmgr_client.cpp",
95      "src/native_buffer.cpp",
96      "src/object_collector.cpp",
97      "src/servmgr_client.c",
98      "src/servstat_listener.c",
99      "src/servstat_listener_stub.cpp",
100      "src/stub_collector.cpp",
101    ]
102
103    if (is_standard_system) {
104      deps = [
105        "../ipc:libhdf_ipc_adapter",
106        "../pub_utils:libpub_utils",
107      ]
108      external_deps = [
109        "c_utils:utils",
110        "hilog:libhilog",
111        "ipc:ipc_single",
112        "samgr:samgr_proxy",
113      ]
114    } else {
115      external_deps = [
116        "hilog:libhilog",
117        "ipc:ipc_single",
118        "samgr:samgr_proxy",
119      ]
120    }
121
122    innerapi_tags = [
123      "chipsetsdk",
124      "platformsdk_indirect",
125    ]
126    install_images = [ system_base_dir ]
127    subsystem_name = "hdf"
128    part_name = "hdf_core"
129  }
130}
131