• 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("./../uhdf.gni")
16
17hdf_framework_path = "./../../../framework"
18hdf_interfaces_path = "./../../../interfaces"
19hdf_uhdf_path = "./.."
20
21config("libhdf_host_public_config") {
22  visibility = [ ":*" ]
23
24  include_dirs = [
25    "$hdf_interfaces_path/inner_api/core",
26    "$hdf_interfaces_path/inner_api/osal/shared",
27    "$hdf_interfaces_path/inner_api/host/shared",
28    "$hdf_interfaces_path/inner_api/host/uhdf",
29  ]
30}
31if (defined(ohos_lite)) {
32  group("libhdf_host") {
33    deps = []
34  }
35} else {
36  ohos_shared_library("libhdf_host") {
37    if (target_cpu == "arm64" || target_cpu == "x86_64") {
38      defines = [ "__ARCH64__" ]
39    }
40
41    public_configs = [ ":libhdf_host_public_config" ]
42    include_dirs = [
43      "$hdf_framework_path/core/manager/include",
44      "$hdf_framework_path/core/host/include",
45      "$hdf_framework_path/core/shared/include",
46      "$hdf_framework_path/utils/include",
47      "$hdf_uhdf_path/include/host",
48      "$hdf_uhdf_path/shared/include",
49      "$hdf_uhdf_path/manager/include",
50      "$hdf_uhdf_path/security/include",
51      "$hdf_uhdf_path/utils/include",
52      "$hdf_uhdf_path/osal/include",
53      "include",
54    ]
55
56    sources = [
57      "$hdf_framework_path/core/host/src/devhost_service.c",
58      "$hdf_framework_path/core/host/src/devmgr_service_clnt.c",
59      "$hdf_framework_path/core/host/src/devsvc_manager_clnt.c",
60      "$hdf_framework_path/core/host/src/hdf_device.c",
61      "$hdf_framework_path/core/host/src/hdf_device_node.c",
62      "$hdf_framework_path/core/host/src/hdf_device_object.c",
63      "$hdf_framework_path/core/host/src/hdf_device_token.c",
64      "$hdf_framework_path/core/host/src/hdf_load_vdi.c",
65      "$hdf_framework_path/core/host/src/hdf_observer_record.c",
66      "$hdf_framework_path/core/host/src/hdf_power_manager.c",
67      "$hdf_framework_path/core/host/src/hdf_service_observer.c",
68      "$hdf_framework_path/core/host/src/hdf_service_subscriber.c",
69      "$hdf_framework_path/core/host/src/power_state_token.c",
70      "$hdf_framework_path/core/manager/src/hdf_host_info.c",
71      "$hdf_framework_path/core/shared/src/hdf_device_info.c",
72      "$hdf_framework_path/core/shared/src/hdf_object_manager.c",
73      "$hdf_framework_path/core/shared/src/hdf_service_record.c",
74      "$hdf_framework_path/utils/src/hdf_task_queue.c",
75      "$hdf_uhdf_path/host/src/devhost_dump.c",
76      "$hdf_uhdf_path/host/src/devhost_object_config.c",
77      "$hdf_uhdf_path/host/src/devhost_service_full.c",
78      "$hdf_uhdf_path/host/src/devhost_service_stub.c",
79      "$hdf_uhdf_path/host/src/device_service_stub.c",
80      "$hdf_uhdf_path/host/src/device_token_stub.c",
81      "$hdf_uhdf_path/host/src/devmgr_service_proxy.c",
82      "$hdf_uhdf_path/host/src/devsvc_manager_proxy.c",
83      "$hdf_uhdf_path/host/src/driver_loader_full.c",
84      "$hdf_uhdf_path/host/src/hdf_device_thread.c",
85      "$hdf_uhdf_path/host/src/hdf_devsvc_manager_clnt.c",
86      "$hdf_uhdf_path/host/src/hdf_pm_reg.c",
87      "$hdf_uhdf_path/shared/src/dev_attribute_serialize.c",
88      "$hdf_uhdf_path/shared/src/hcb_config_entry.c",
89    ]
90
91    if (is_standard_system) {
92      deps = [
93        "../ipc:libhdf_ipc_adapter",
94        "../utils:libhdf_utils",
95      ]
96      external_deps = [
97        "c_utils:utils",
98        "hilog:libhilog",
99      ]
100    } else {
101      external_deps = [ "hilog:libhilog" ]
102    }
103
104    install_images = [ chipset_base_dir ]
105    subsystem_name = "hdf"
106    part_name = "hdf_core"
107  }
108
109  ohos_executable("hdf_devhost") {
110    include_dirs = [
111      "$hdf_framework_path/core/manager/include",
112      "$hdf_framework_path/core/host/include",
113      "$hdf_framework_path/core/shared/include",
114      "$hdf_framework_path/utils/include",
115      "$hdf_uhdf_path/include/host",
116      "$hdf_uhdf_path/shared/include",
117      "$hdf_uhdf_path/manager/include",
118      "$hdf_uhdf_path/osal/include",
119      "$hdf_interfaces_path/inner_api/core",
120      "include",
121    ]
122
123    sources = [ "devhost.c" ]
124
125    if (is_standard_system) {
126      deps = [
127        "../host:libhdf_host",
128        "../ipc:libhdf_ipc_adapter",
129        "../utils:libhdf_utils",
130      ]
131      external_deps = [
132        "c_utils:utils",
133        "hilog:libhilog",
134        "init:libbegetutil",
135      ]
136    } else {
137      external_deps = [ "hilog:libhilog" ]
138    }
139
140    # Ensure that the maximum page size is 4096 and the load section is aligned
141    ldflags = [
142      "-Wl,-z,max-page-size=4096",
143      "-Wl,-z,separate-code",
144    ]
145
146    install_enable = true
147    install_images = [ chipset_base_dir ]
148    subsystem_name = "hdf"
149    part_name = "hdf_core"
150  }
151}
152