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/adapter/uhdf2/uhdf.gni") 16 17config("libhdf_host_pub_config") { 18 visibility = [ ":*" ] 19 20 include_dirs = [ 21 "//utils/native/base/include", 22 "$hdf_framework_path/core/manager/include", 23 "$hdf_framework_path/core/host/include", 24 "$hdf_framework_path/core/shared/include", 25 "$hdf_uhdf_path/include/host", 26 "$hdf_uhdf_path/shared/include", 27 "$hdf_uhdf_path/manager/include", 28 "include", 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") { 38 defines = [ "__ARM64__" ] 39 } 40 41 public_configs = [ ":libhdf_host_pub_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_uhdf_path/include/host", 47 "$hdf_uhdf_path/shared/include", 48 "$hdf_uhdf_path/manager/include", 49 "$hdf_uhdf_path/security/include", 50 "$hdf_uhdf_path/utils/include", 51 "include", 52 ] 53 54 sources = [ 55 "$hdf_framework_path/core/host/src/devhost_service.c", 56 "$hdf_framework_path/core/host/src/devmgr_service_clnt.c", 57 "$hdf_framework_path/core/host/src/devsvc_manager_clnt.c", 58 "$hdf_framework_path/core/host/src/hdf_device.c", 59 "$hdf_framework_path/core/host/src/hdf_device_node.c", 60 "$hdf_framework_path/core/host/src/hdf_device_object.c", 61 "$hdf_framework_path/core/host/src/hdf_device_token.c", 62 "$hdf_framework_path/core/host/src/hdf_observer_record.c", 63 "$hdf_framework_path/core/host/src/hdf_power_manager.c", 64 "$hdf_framework_path/core/host/src/hdf_service_observer.c", 65 "$hdf_framework_path/core/host/src/hdf_service_subscriber.c", 66 "$hdf_framework_path/core/host/src/power_state_token.c", 67 "$hdf_framework_path/core/manager/src/hdf_host_info.c", 68 "$hdf_framework_path/core/shared/src/hdf_device_info.c", 69 "$hdf_framework_path/core/shared/src/hdf_object_manager.c", 70 "$hdf_framework_path/core/shared/src/hdf_service_record.c", 71 "$hdf_framework_path/utils/src/hdf_task_queue.c", 72 "$hdf_uhdf_path/host/src/devhost_object_config.c", 73 "$hdf_uhdf_path/host/src/devhost_service_full.c", 74 "$hdf_uhdf_path/host/src/devhost_service_stub.c", 75 "$hdf_uhdf_path/host/src/device_service_stub.c", 76 "$hdf_uhdf_path/host/src/device_token_stub.c", 77 "$hdf_uhdf_path/host/src/devmgr_service_proxy.c", 78 "$hdf_uhdf_path/host/src/devsvc_manager_proxy.c", 79 "$hdf_uhdf_path/host/src/driver_loader_full.c", 80 "$hdf_uhdf_path/host/src/hdf_device_thread.c", 81 "$hdf_uhdf_path/host/src/hdf_devsvc_manager_clnt.c", 82 "$hdf_uhdf_path/host/src/hdf_pm_reg.c", 83 "$hdf_uhdf_path/shared/src/dev_attribute_serialize.c", 84 "$hdf_uhdf_path/shared/src/hcb_config_entry.c", 85 ] 86 87 deps = [ 88 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 89 "$hdf_uhdf_path/utils:libhdf_utils", 90 ] 91 92 if (is_standard_system) { 93 external_deps = [ 94 "hiviewdfx_hilog_native:libhilog", 95 "utils_base:utils", 96 ] 97 } else { 98 external_deps = [ "hilog:libhilog" ] 99 } 100 101 cflags = [ 102 "-Wall", 103 "-Wextra", 104 "-Werror", 105 ] 106 107 install_images = [ chipset_base_dir ] 108 subsystem_name = "hdf" 109 part_name = "device_driver_framework" 110 } 111 112 ohos_executable("hdf_devhost") { 113 include_dirs = [ 114 "//utils/native/base/include", 115 "$hdf_framework_path/core/manager/include", 116 "$hdf_framework_path/core/host/include", 117 "$hdf_framework_path/core/shared/include", 118 "$hdf_uhdf_path/ipc/include", 119 "$hdf_uhdf_path/osal/include", 120 "$hdf_uhdf_path/include/host", 121 "$hdf_uhdf_path/shared/include", 122 "$hdf_uhdf_path/manager/include", 123 "include", 124 ] 125 126 sources = [ "devhost.c" ] 127 128 deps = [ 129 "$hdf_uhdf_path/host:libhdf_host", 130 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 131 "$hdf_uhdf_path/utils:libhdf_utils", 132 ] 133 134 if (is_standard_system) { 135 external_deps = [ 136 "hiviewdfx_hilog_native:libhilog", 137 "utils_base:utils", 138 ] 139 } else { 140 external_deps = [ "hilog:libhilog" ] 141 } 142 143 cflags = [ 144 "-Wall", 145 "-Wextra", 146 "-Werror", 147 ] 148 149 install_enable = true 150 install_images = [ chipset_base_dir ] 151 subsystem_name = "hdf" 152 part_name = "device_driver_framework" 153 } 154} 155 156ohos_prebuilt_etc("hdf_devhost.rc") { 157 if (use_musl) { 158 source = "hdf_devhostmusl.cfg" 159 } else { 160 source = "hdf_devhost.cfg" 161 } 162 relative_install_dir = "init" 163 install_images = [ chipset_base_dir ] 164 subsystem_name = "hdf" 165 part_name = "device_driver_framework" 166} 167