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