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 17interfaces_folder_path = "./../../../interfaces" 18hdf_framework_path = "./../../../framework" 19hdf_uhdf_path = "./.." 20 21group("uhdf_utils_pkg") { 22 deps = [ ":libhdf_utils" ] 23} 24if (defined(ohos_lite)) { 25 config("libhdf_utils_pub_config") { 26 visibility = [ ":*" ] 27 28 include_dirs = [ 29 "$interfaces_folder_path/inner_api/osal/shared", 30 "$interfaces_folder_path/inner_api/osal/uhdf", 31 "$interfaces_folder_path/inner_api/utils", 32 "$interfaces_folder_path/inner_api/core", 33 ] 34 } 35 36 ohos_shared_library("libhdf_utils") { 37 output_extension = "z.so" 38 public_configs = [ ":libhdf_utils_pub_config" ] 39 include_dirs = [ 40 "$hdf_framework_path/include", 41 "$hdf_framework_path/include/core", 42 "$hdf_framework_path/include/osal", 43 "$hdf_framework_path/include/utils", 44 "$hdf_framework_path/utils/include", 45 "$hdf_framework_path/core/adapter/syscall/include", 46 "$hdf_framework_path/core/adapter/vnode/include", 47 "$hdf_framework_path/core/shared/include", 48 "$hdf_framework_path/include/core/", 49 "$hdf_framework_path/core/common/include/host", 50 "$hdf_uhdf_path/osal/include", 51 "$hdf_uhdf_path/utils/include", 52 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 53 ] 54 sources = [ 55 "$hdf_framework_path/core/adapter/syscall/src/hdf_devmgr_adapter.c", 56 "$hdf_framework_path/core/adapter/syscall/src/hdf_syscall_adapter.c", 57 "$hdf_framework_path/core/shared/src/hdf_io_service.c", 58 "$hdf_framework_path/support/posix/src/osal_mem.c", 59 "$hdf_framework_path/support/posix/src/osal_mutex.c", 60 "$hdf_framework_path/support/posix/src/osal_sem.c", 61 "$hdf_framework_path/support/posix/src/osal_spinlock.c", 62 "$hdf_framework_path/support/posix/src/osal_thread.c", 63 "$hdf_framework_path/support/posix/src/osal_time.c", 64 "$hdf_framework_path/utils/src/hcs_parser/device_resource_if.c", 65 "$hdf_framework_path/utils/src/hcs_parser/hcs_blob_if.c", 66 "$hdf_framework_path/utils/src/hcs_parser/hcs_generate_tree.c", 67 "$hdf_framework_path/utils/src/hcs_parser/hcs_parser.c", 68 "$hdf_framework_path/utils/src/hcs_parser/hcs_tree_if.c", 69 "$hdf_framework_path/utils/src/hdf_cstring.c", 70 "$hdf_framework_path/utils/src/hdf_map.c", 71 "$hdf_framework_path/utils/src/hdf_message_looper.c", 72 "$hdf_framework_path/utils/src/hdf_message_task.c", 73 "$hdf_framework_path/utils/src/hdf_sbuf.c", 74 "$hdf_framework_path/utils/src/hdf_sbuf_impl_raw.c", 75 "$hdf_framework_path/utils/src/hdf_slist.c", 76 "$hdf_framework_path/utils/src/hdf_sref.c", 77 "$hdf_framework_path/utils/src/hdf_thread_ex.c", 78 "$hdf_framework_path/utils/src/osal_message.c", 79 "$hdf_framework_path/utils/src/osal_msg_queue.c", 80 "$hdf_uhdf_path/osal/src/osal_sysevent.c", 81 "$hdf_uhdf_path/utils/src/hcs_parser/hcs_blob_load.c", 82 "$hdf_uhdf_path/utils/src/hcs_parser/hcs_dm_parser.c", 83 ] 84 85 public_deps = 86 [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] 87 88 subsystem_name = "hdf" 89 part_name = "hdf_core" 90 } 91} else { 92 config("libhdf_utils_public_config") { 93 visibility = [ ":*" ] 94 95 include_dirs = [ 96 "$interfaces_folder_path/inner_api/osal/shared", 97 "$interfaces_folder_path/inner_api/osal/uhdf", 98 "$interfaces_folder_path/inner_api/utils", 99 "$interfaces_folder_path/inner_api/core", 100 "$interfaces_folder_path/inner_api/ipc", 101 "$interfaces_folder_path/inner_api/hdi", 102 ] 103 defines = [ "__OHOS_USER__" ] 104 105 if (is_standard_system) { 106 defines += [ "__OHOS_STANDARD_SYS__" ] 107 } 108 } 109 110 ohos_shared_library("libhdf_utils") { 111 include_dirs = [ 112 "$hdf_framework_path/include", 113 "$hdf_framework_path/include/core", 114 "$hdf_framework_path/include/osal", 115 "$hdf_framework_path/include/utils", 116 "$hdf_framework_path/utils/include", 117 "$hdf_framework_path/core/adapter/syscall/include", 118 "$hdf_framework_path/core/adapter/vnode/include", 119 "$hdf_framework_path/core/shared/include", 120 "$hdf_framework_path/include/core/", 121 "$hdf_uhdf_path/osal/include", 122 "$hdf_uhdf_path/utils/include", 123 ] 124 public_configs = [ ":libhdf_utils_public_config" ] 125 sources = [ 126 "$hdf_framework_path/core/adapter/syscall/src/hdf_devmgr_adapter.c", 127 "$hdf_framework_path/core/adapter/syscall/src/hdf_syscall_adapter.c", 128 "$hdf_framework_path/core/shared/src/hdf_io_service.c", 129 "$hdf_framework_path/core/shared/src/ioserstat_listener.c", 130 "$hdf_framework_path/core/shared/src/service_status.c", 131 "$hdf_framework_path/core/shared/src/svcmgr_ioservice.c", 132 "$hdf_framework_path/support/posix/src/osal_mem.c", 133 "$hdf_framework_path/support/posix/src/osal_mutex.c", 134 "$hdf_framework_path/support/posix/src/osal_sem.c", 135 "$hdf_framework_path/support/posix/src/osal_spinlock.c", 136 "$hdf_framework_path/support/posix/src/osal_thread.c", 137 "$hdf_framework_path/support/posix/src/osal_time.c", 138 "$hdf_framework_path/utils/src/hcs_parser/device_resource_if.c", 139 "$hdf_framework_path/utils/src/hcs_parser/hcs_blob_if.c", 140 "$hdf_framework_path/utils/src/hcs_parser/hcs_generate_tree.c", 141 "$hdf_framework_path/utils/src/hcs_parser/hcs_parser.c", 142 "$hdf_framework_path/utils/src/hcs_parser/hcs_tree_if.c", 143 "$hdf_framework_path/utils/src/hdf_cstring.c", 144 "$hdf_framework_path/utils/src/hdf_map.c", 145 "$hdf_framework_path/utils/src/hdf_message_looper.c", 146 "$hdf_framework_path/utils/src/hdf_message_task.c", 147 "$hdf_framework_path/utils/src/hdf_sbuf.c", 148 "$hdf_framework_path/utils/src/hdf_sbuf_impl_raw.c", 149 "$hdf_framework_path/utils/src/hdf_slist.c", 150 "$hdf_framework_path/utils/src/hdf_sref.c", 151 "$hdf_framework_path/utils/src/hdf_thread_ex.c", 152 "$hdf_framework_path/utils/src/osal_message.c", 153 "$hdf_framework_path/utils/src/osal_msg_queue.c", 154 "$hdf_uhdf_path/osal/src/osal_sysevent.c", 155 "$hdf_uhdf_path/utils/src/hcs_parser/hcs_blob_load.c", 156 "$hdf_uhdf_path/utils/src/hcs_parser/hcs_dm_parser.c", 157 "$hdf_uhdf_path/utils/src/shared_mem.cpp", 158 ] 159 160 if (is_standard_system) { 161 external_deps = [ 162 "c_utils:utils", 163 "hilog:libhilog", 164 ] 165 } else { 166 external_deps = [ "hilog:libhilog" ] 167 } 168 169 innerapi_tags = [ "chipsetsdk" ] 170 subsystem_name = "hdf" 171 part_name = "hdf_core" 172 install_images = [ 173 "system", 174 "updater", 175 ] 176 } 177} 178