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