• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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
14if (defined(ohos_lite)) {
15  import("//build/lite/config/component/lite_component.gni")
16} else {
17  import("//build/ohos.gni")
18}
19
20import("//foundation/distributedhardware/device_manager/device_manager.gni")
21
22if (defined(ohos_lite)) {
23  if (ohos_kernel_type == "liteos_m") {
24    static_library("devicemanagerutils_mini") {
25      include_dirs = [
26        "${utils_path}/include",
27        "${utils_path}/include/crypto",
28        "${utils_path}/include/dfx",
29        "${utils_path}/include/dfx/lite",
30        "${utils_path}/include/permission/lite",
31        "${common_path}/include",
32        "${innerkits_path}/native_cpp/include",
33      ]
34
35      include_dirs += [
36        "//base/security/device_auth/interfaces/innerkits",
37        "//base/startup/init/interfaces/innerkits/include/syspara",
38        "//commonlibrary/utils_lite/include",
39        "//utils/system/safwk/native/include",
40        "//third_party/json/include",
41        "//third_party/openssl/include",
42        "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
43        "//third_party/bounds_checking_function/include",
44        "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
45      ]
46
47      sources = [
48        "${utils_path}/src/crypto/dm_crypto.cpp",
49        "${utils_path}/src/dfx/lite/dm_hidumper.cpp",
50        "${utils_path}/src/dfx/lite/dm_hisysevent.cpp",
51        "${utils_path}/src/dfx/lite/dm_hitrace.cpp",
52        "${utils_path}/src/dm_anonymous.cpp",
53        "${utils_path}/src/dm_error_message.cpp",
54        "${utils_path}/src/dm_log.cpp",
55        "${utils_path}/src/dm_random.cpp",
56        "${utils_path}/src/permission/lite/permission_manager.cpp",
57      ]
58
59      defines = [
60        "__LITEOS_M__",
61        "HI_LOG_ENABLE",
62        "DH_LOG_TAG=\"devicemanagerutils\"",
63        "LOG_DOMAIN=0xD004100",
64      ]
65
66      deps = [
67        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static",
68        "//base/startup/init/interfaces/innerkits:libbegetutil",
69        "//commonlibrary/utils_lite:utils",
70        "//foundation/systemabilitymgr/samgr_lite/samgr",
71        "//third_party/bounds_checking_function:libsec_static",
72        "//third_party/mbedtls",
73        "//third_party/mbedtls:mbedtls_shared",
74      ]
75    }
76  } else {
77    shared_library("devicemanagerutils") {
78      include_dirs = [
79        "${common_path}/include",
80        "${common_path}/include/ipc",
81        "${common_path}/include/ipc/lite",
82        "${common_path}/include/ipc/model",
83        "${common_path}/include/dfx",
84        "${common_path}/include/dfx/lite",
85        "${innerkits_path}/native_cpp/include",
86        "include",
87        "include/crypto",
88        "include/fwkload/lite",
89        "include/permission/lite",
90      ]
91      include_dirs += [
92        "//base/security/device_auth/interfaces/innerkits",
93        "//base/startup/init/interfaces/innerkits/include/syspara",
94        "//commonlibrary/utils_lite/include",
95        "//utils/system/safwk/native/include",
96        "//third_party/json/include",
97        "//third_party/openssl/include",
98        "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
99        "//third_party/bounds_checking_function/include",
100        "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include",
101        "//foundation/communication/dsoftbus/interfaces/kits/bus_center",
102        "//foundation/communication/dsoftbus/interfaces/kits/common",
103        "//foundation/communication/dsoftbus/interfaces/kits/discovery",
104        "//foundation/communication/dsoftbus/interfaces/kits/transport",
105        "//foundation/communication/dsoftbus/interfaces/inner_kits/transport",
106        "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
107      ]
108      sources = [
109        "${common_path}/src/dfx/lite/dm_hidumper.cpp",
110        "${common_path}/src/dfx/lite/dm_hisysevent.cpp",
111        "${common_path}/src/dfx/lite/dm_hitrace.cpp",
112        "${common_path}/src/dm_anonymous.cpp",
113        "${common_path}/src/dm_error_message.cpp",
114        "${common_path}/src/dm_log.cpp",
115        "${common_path}/src/ipc/lite/ipc_cmd_register.cpp",
116        "src/crypto/dm_crypto.cpp",
117        "src/dm_random.cpp",
118        "src/fwkload/lite/dm_distributed_hardware_load.cpp",
119        "src/permission/lite/permission_manager.cpp",
120      ]
121      defines = [
122        "LITE_DEVICE",
123        "hI_LOG_ENABLE",
124        "DH_LOG_TAG=\"devicemanagerutils\"",
125        "lOG_DOMAIN=0xD004100",
126      ]
127      deps = [
128        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
129        "//base/startup/init/interfaces/innerkits:libbegetutil",
130        "//commonlibrary/utils_lite:utils",
131        "//foundation/communication/dsoftbus/sdk:softbus_client",
132        "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
133        "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
134        "//third_party/bounds_checking_function:libsec_shared",
135        "//third_party/mbedtls:mbedtls_shared",
136      ]
137    }
138  }
139} else {
140  config("devicemanagerutils_config") {
141    include_dirs = [
142      "include",
143      "include/crypto",
144      "include/fwkload/standard",
145      "include/permission/standard",
146      "${common_path}/include",
147      "${common_path}/include/ipc",
148      "${common_path}/include/ipc/model",
149      "${common_path}/include/ipc/standard",
150      "${common_path}/include/dfx",
151      "${common_path}/include/dfx/standard",
152      "${innerkits_path}/native_cpp/include",
153      "//foundation/bundlemanager/bundle_framework/interfaces/inner_api/appexecfwk_base/include",
154      "//foundation/ability/ability_base/interfaces/kits/native/want/include",
155      "//foundation/ability/ability_base/interfaces/kits/native/uri/include",
156      "//foundation/ability/ability_base/interfaces/inner_api/base/include",
157      "//third_party/mbedtls/include/mbedtls",
158      "//third_party/json/include",
159      "//third_party/openssl/include",
160    ]
161  }
162
163  ohos_shared_library("devicemanagerutils") {
164    sources = [
165      "${common_path}/src/dfx/standard/dm_hidumper.cpp",
166      "${common_path}/src/dfx/standard/dm_hisysevent.cpp",
167      "${common_path}/src/dfx/standard/dm_hitrace.cpp",
168      "${common_path}/src/dm_anonymous.cpp",
169      "${common_path}/src/dm_error_message.cpp",
170      "${common_path}/src/dm_log.cpp",
171      "${common_path}/src/ipc/standard/ipc_cmd_register.cpp",
172      "src/crypto/dm_crypto.cpp",
173      "src/dm_random.cpp",
174    ]
175    if (support_jsapi) {
176      sources += [
177        "src/fwkload/standard/dm_distributed_hardware_load.cpp",
178        "src/permission/standard/permission_manager.cpp",
179      ]
180    }
181
182    public_configs = [ ":devicemanagerutils_config" ]
183
184    defines = [
185      "HI_LOG_ENABLE",
186      "DH_LOG_TAG=\"devicemanagerutils\"",
187      "LOG_DOMAIN=0xD004100",
188    ]
189
190    deps = [
191      "//third_party/mbedtls:mbedtls_shared",
192      "//third_party/openssl:libcrypto_shared",
193    ]
194
195    external_deps = [
196      "access_token:libaccesstoken_sdk",
197      "c_utils:utils",
198      "hisysevent_native:libhisysevent",
199      "hitrace_native:hitrace_meter",
200      "hiviewdfx_hilog_native:libhilog",
201      "ipc:ipc_core",
202      "samgr:samgr_proxy",
203    ]
204    if (support_jsapi) {
205      external_deps += [ "bundle_framework:appexecfwk_core" ]
206    }
207
208    subsystem_name = "distributedhardware"
209
210    part_name = "device_manager"
211  }
212}
213