• 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")
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      "//commonlibrary/c_utils/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    subsystem_name = "hdf"
79    part_name = "hdf_core"
80  }
81} else {
82  config("libhdf_utils_all_dependent_config") {
83    visibility = [ ":*" ]
84
85    include_dirs = [
86      "//commonlibrary/c_utils/base/include",
87      "$hdf_framework_path/include",
88      "$hdf_framework_path/include/core",
89      "$hdf_framework_path/include/osal",
90      "$hdf_framework_path/include/utils",
91      "$hdf_framework_path/utils/include",
92      "$hdf_framework_path/core/adapter/syscall/include",
93      "$hdf_framework_path/core/adapter/vnode/include",
94      "$hdf_framework_path/core/shared/include",
95      "$hdf_framework_path/include/core/",
96      "$hdf_uhdf_path/osal/include",
97      "$hdf_uhdf_path/utils/include",
98    ]
99    defines = [ "__OHOS_USER__" ]
100
101    if (is_standard_system) {
102      defines += [ "__OHOS_STANDARD_SYS__" ]
103    }
104  }
105
106  ohos_shared_library("libhdf_utils") {
107    all_dependent_configs = [ ":libhdf_utils_all_dependent_config" ]
108    sources = [
109      "$hdf_framework_path/core/adapter/syscall/src/hdf_devmgr_adapter.c",
110      "$hdf_framework_path/core/adapter/syscall/src/hdf_syscall_adapter.c",
111      "$hdf_framework_path/core/shared/src/hdf_io_service.c",
112      "$hdf_framework_path/core/shared/src/ioserstat_listener.c",
113      "$hdf_framework_path/core/shared/src/service_status.c",
114      "$hdf_framework_path/core/shared/src/svcmgr_ioservice.c",
115      "$hdf_framework_path/support/posix/src/osal_mem.c",
116      "$hdf_framework_path/support/posix/src/osal_mutex.c",
117      "$hdf_framework_path/support/posix/src/osal_sem.c",
118      "$hdf_framework_path/support/posix/src/osal_spinlock.c",
119      "$hdf_framework_path/support/posix/src/osal_thread.c",
120      "$hdf_framework_path/support/posix/src/osal_time.c",
121      "$hdf_framework_path/utils/src/hcs_parser/device_resource_if.c",
122      "$hdf_framework_path/utils/src/hcs_parser/hcs_blob_if.c",
123      "$hdf_framework_path/utils/src/hcs_parser/hcs_generate_tree.c",
124      "$hdf_framework_path/utils/src/hcs_parser/hcs_parser.c",
125      "$hdf_framework_path/utils/src/hcs_parser/hcs_tree_if.c",
126      "$hdf_framework_path/utils/src/hdf_cstring.c",
127      "$hdf_framework_path/utils/src/hdf_map.c",
128      "$hdf_framework_path/utils/src/hdf_message_looper.c",
129      "$hdf_framework_path/utils/src/hdf_message_task.c",
130      "$hdf_framework_path/utils/src/hdf_sbuf.c",
131      "$hdf_framework_path/utils/src/hdf_sbuf_impl_raw.c",
132      "$hdf_framework_path/utils/src/hdf_slist.c",
133      "$hdf_framework_path/utils/src/hdf_sref.c",
134      "$hdf_framework_path/utils/src/hdf_thread_ex.c",
135      "$hdf_framework_path/utils/src/osal_message.c",
136      "$hdf_framework_path/utils/src/osal_msg_queue.c",
137      "$hdf_uhdf_path/osal/src/osal_sysevent.c",
138      "$hdf_uhdf_path/utils/src/hcs_parser/hcs_blob_load.c",
139      "$hdf_uhdf_path/utils/src/hcs_parser/hcs_dm_parser.c",
140      "$hdf_uhdf_path/utils/src/shared_mem.cpp",
141    ]
142
143    if (is_standard_system) {
144      external_deps = [
145        "c_utils:utils",
146        "hiviewdfx_hilog_native:libhilog",
147      ]
148    } else {
149      external_deps = [ "hilog:libhilog" ]
150    }
151
152    subsystem_name = "hdf"
153    part_name = "hdf_core"
154    install_images = [
155      system_base_dir,
156      "updater",
157    ]
158    relative_install_dir = "chipset-pub-sdk"
159  }
160}
161