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