• 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("devicemanagerservice_mini") {
25      include_dirs = [
26        "${innerkits_path}/native_cpp/include",
27        "${innerkits_path}/native_cpp/include/notify",
28        "${servicesimpl_path}/include",
29        "${servicesimpl_path}/include/config",
30        "${servicesimpl_path}/include/adapter",
31        "${servicesimpl_path}/include/authentication",
32        "${servicesimpl_path}/include/authentication/showconfirm/lite",
33        "${servicesimpl_path}/include/ability",
34        "${servicesimpl_path}/include/credential",
35        "${servicesimpl_path}/include/devicestate",
36        "${servicesimpl_path}/include/discovery",
37        "${servicesimpl_path}/include/dependency/commonevent",
38        "${servicesimpl_path}/include/dependency/multipleuser",
39        "${servicesimpl_path}/include/dependency/hichain",
40        "${servicesimpl_path}/include/dependency/softbus",
41        "${servicesimpl_path}/include/dependency/mini",
42        "${servicesimpl_path}/include/dependency/timer",
43        "${servicesimpl_path}/include/dispatch",
44        "${servicesimpl_path}/include/eventbus",
45        "${common_path}/include",
46        "${common_path}/include/ipc",
47        "${common_path}/include/ipc/model",
48        "${utils_path}/include",
49        "${utils_path}/include/dfx",
50        "${utils_path}/include/dfx/lite",
51        "${utils_path}/include/permission/lite",
52        "foundation/multimedia/image_framework/mock/native/include",
53        "${ext_path}/pin_auth/include",
54        "${ext_path}/pin_auth/include/lite",
55        "//third_party/json/include",
56        "//third_party/bounds_checking_function/include",
57      ]
58
59      sources = [
60        "${servicesimpl_path}/src/ability/lite/dm_ability_manager.cpp",
61        "${servicesimpl_path}/src/adapter/standard/dm_adapter_manager.cpp",
62        "${servicesimpl_path}/src/authentication/auth_message_processor.cpp",
63        "${servicesimpl_path}/src/authentication/auth_request_state.cpp",
64        "${servicesimpl_path}/src/authentication/auth_response_state.cpp",
65        "${servicesimpl_path}/src/authentication/dm_auth_manager.cpp",
66        "${servicesimpl_path}/src/authentication/showconfirm/lite/show_confirm.cpp",
67        "${servicesimpl_path}/src/config/mini/dm_config_manager.cpp",
68        "${servicesimpl_path}/src/config/mini/pin_auth.cpp",
69        "${servicesimpl_path}/src/dependency/hichain/hichain_connector.cpp",
70        "${servicesimpl_path}/src/dependency/mini/dm_mutex.cpp",
71        "${servicesimpl_path}/src/dependency/mini/dm_thread.cpp",
72        "${servicesimpl_path}/src/dependency/multipleuser/multiple_user_connector.cpp",
73        "${servicesimpl_path}/src/dependency/softbus/softbus_connector.cpp",
74        "${servicesimpl_path}/src/dependency/softbus/softbus_session.cpp",
75        "${servicesimpl_path}/src/dependency/timer/mini/dm_timer.cpp",
76        "${servicesimpl_path}/src/devicestate/dm_device_state_manager.cpp",
77        "${servicesimpl_path}/src/discovery/dm_discovery_manager.cpp",
78        "${servicesimpl_path}/src/dispatch/command_dispatch.cpp",
79        "${servicesimpl_path}/src/dispatch/device_manager_service_listener_mini.cpp",
80        "${servicesimpl_path}/src/dispatch/server_stub.cpp",
81      ]
82
83      defines = [
84        "__LITEOS_M__",
85        "HI_LOG_ENABLE",
86        "DH_LOG_TAG=\"devicemanagerserviceimpl\"",
87        "LOG_DOMAIN=0xD004100",
88      ]
89
90      if (os_account_part_exists) {
91        defines += [ "OS_ACCOUNT_PART_EXISTS" ]
92        include_dirs += [
93          "${os_account_path }/interfaces/innerkits/osaccount/native/include",
94        ]
95      }
96
97      ldflags = dm_ldflags
98
99      deps = [
100        "${innerkits_path}/native_cpp:devicemanagersdk_mini",
101        "${utils_path}:devicemanagerutils_mini",
102        "//third_party/bounds_checking_function:libsec_static",
103        "//third_party/mbedtls",
104      ]
105
106      external_deps = [
107        "device_auth:deviceauth_sdk",
108        "dsoftbus:softbus_client",
109        "hilog_lite:hilog_static",
110        "init:libbegetutil",
111        "ipc:ipc_single",
112        "safwk:system_ability_fwk",
113        "utils_lite:utils",
114      ]
115    }
116  }
117} else if (!support_jsapi) {
118  group("devicemanagerserviceimpl") {
119    deps = []
120  }
121} else {
122  config("devicemanagerserviceimpl_config") {
123    include_dirs = [
124      "include",
125      "include/config",
126      "include/adapter",
127      "include/authentication",
128      "include/authentication/showconfirm/standard",
129      "include/ability",
130      "include/credential",
131      "include/devicestate",
132      "include/discovery",
133      "include/publish",
134      "include/dependency/commonevent",
135      "include/dependency/multipleuser",
136      "include/dependency/hichain",
137      "include/dependency/softbus",
138      "include/dependency/timer",
139      "${common_path}/include",
140      "${common_path}/include/ipc",
141      "${common_path}/include/ipc/model",
142      "${utils_path}/include",
143      "${utils_path}/include/fwkload/standard",
144      "${utils_path}/include/dfx",
145      "${utils_path}/include/dfx/standard",
146      "${utils_path}/include/permission/standard",
147      "//third_party/json/include",
148      "${services_path}/include",
149      "${services_path}/include/ipc/standard",
150    ]
151
152    if (os_account_part_exists) {
153      include_dirs += [
154        "${os_account_path }/interfaces/innerkits/osaccount/native/include",
155      ]
156    }
157  }
158
159  ohos_shared_library("devicemanagerserviceimpl") {
160    sources = [
161      "${common_path}/src/dm_softbus_adapter_crypto.cpp",
162      "src/ability/standard/dm_ability_manager.cpp",
163      "src/adapter/standard/dm_adapter_manager.cpp",
164      "src/authentication/auth_message_processor.cpp",
165      "src/authentication/auth_request_state.cpp",
166      "src/authentication/auth_response_state.cpp",
167      "src/authentication/auth_ui_state_manager.cpp",
168      "src/authentication/dm_auth_manager.cpp",
169      "src/authentication/showconfirm/standard/show_confirm.cpp",
170      "src/config/dm_config_manager.cpp",
171      "src/credential/dm_credential_manager.cpp",
172      "src/dependency/commonevent/dm_common_event_manager.cpp",
173      "src/dependency/hichain/hichain_connector.cpp",
174      "src/dependency/multipleuser/multiple_user_connector.cpp",
175      "src/dependency/softbus/softbus_connector.cpp",
176      "src/dependency/softbus/softbus_session.cpp",
177      "src/dependency/timer/dm_timer.cpp",
178      "src/device_manager_service_impl.cpp",
179      "src/devicestate/dm_device_state_manager.cpp",
180      "src/discovery/dm_discovery_filter.cpp",
181      "src/discovery/dm_discovery_manager.cpp",
182      "src/publish/dm_publish_manager.cpp",
183    ]
184
185    public_configs = [ ":devicemanagerserviceimpl_config" ]
186
187    defines = [
188      "HI_LOG_ENABLE",
189      "DH_LOG_TAG=\"devicemanagerserviceimpl\"",
190      "LOG_DOMAIN=0xD004100",
191    ]
192
193    deps = [
194      "${innerkits_path}/native_cpp:devicemanagersdk",
195      "${utils_path}:devicemanagerutils",
196      "//third_party/mbedtls:mbedtls_shared",
197    ]
198
199    if (!device_manager_no_interaction_auth) {
200    }
201
202    external_deps = [
203      "ability_base:want",
204      "ability_runtime:ability_manager",
205      "access_token:libaccesstoken_sdk",
206      "c_utils:utils",
207      "common_event_service:cesfwk_core",
208      "common_event_service:cesfwk_innerkits",
209      "device_auth:deviceauth_sdk",
210      "dsoftbus:softbus_client",
211      "init:libbegetutil",
212      "ipc:ipc_core",
213      "resource_management:resmgr_napi_core",
214      "samgr:samgr_proxy",
215    ]
216
217    if (os_account_part_exists) {
218      defines += [ "OS_ACCOUNT_PART_EXISTS" ]
219      external_deps += [ "os_account:os_account_innerkits" ]
220    }
221
222    subsystem_name = "distributedhardware"
223
224    part_name = "device_manager"
225  }
226}
227