1# Copyright (c) 2022-2024 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 == "linux") { 24 shared_library("devicemanagerserviceimpl") { 25 include_dirs = [ 26 "include", 27 "include/ability", 28 "include/adapter", 29 "include/credential", 30 "include/dependency/hichain", 31 "include/dependency/softbus", 32 "include/devicestate", 33 "${common_path}/include", 34 "${common_path}/include/ipc", 35 "${common_path}/include/ipc/model", 36 "${common_path}/include/dfx", 37 "${common_path}/include/dfx/lite", 38 "${devicemanager_path}/commondependency/include", 39 "${innerkits_path}/native_cpp/include", 40 "${devicemanager_path}/radar/include", 41 "${utils_path}/include", 42 "${utils_path}/include/appInfo/lite", 43 "${utils_path}/include/crypto", 44 "${utils_path}/include/fwkload/lite", 45 "${utils_path}/include/timer/lite", 46 "${json_path}/include", 47 "${services_path}/include", 48 "${services_path}/include/ipc/lite", 49 "${interfaces_path}/c/ipc/include", 50 "//foundation/communication/dsoftbus/interfaces/kits/bus_center", 51 "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", 52 "//foundation/communication/dsoftbus/interfaces/kits/common", 53 "//foundation/communication/dsoftbus/interfaces/kits/transport", 54 "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr", 55 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", 56 "//commonlibrary/c_utils/base/include", 57 "${softbuscache_parh}/include", 58 ] 59 60 sources = [ 61 "${devicemanager_path}/commondependency/src/multiple_user_connector.cpp", 62 "src/ability/lite/dm_ability_manager.cpp", 63 "src/adapter/lite/dm_adapter_manager.cpp", 64 "src/credential/dm_credential_manager.cpp", 65 "src/dependency/hichain/hichain_auth_connector.cpp", 66 "src/dependency/hichain/hichain_connector.cpp", 67 "src/dependency/hichain/mine_hichain_connector.cpp", 68 "src/dependency/softbus/softbus_connector.cpp", 69 "src/device_manager_service_impl_lite.cpp", 70 "src/devicestate/dm_device_state_manager.cpp", 71 ] 72 73 defines = [ 74 "LITE_DEVICE", 75 "DH_LOG_ENABLE", 76 "DH_LOG_TAG=\"devicemanagerserviceimpl\"", 77 "LOG_DOMAIN=0xD004110", 78 ] 79 80 deps = [ 81 "${devicemanager_path}/radar:devicemanagerradar", 82 "${json_path}:devicemanagerjson", 83 "${softbuscache_parh}:dmdevicecache", 84 "${utils_path}:devicemanagerutils", 85 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 86 "//base/security/device_auth/services:deviceauth_sdk", 87 "//base/startup/init/interfaces/innerkits:libbegetutil", 88 "//commonlibrary/utils_lite:utils", 89 "//foundation/communication/dsoftbus:dsoftbus", 90 "//foundation/systemabilitymgr/safwk_lite:safwk_lite", 91 "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", 92 "//third_party/bounds_checking_function:libsec_shared", 93 ] 94 95 cflags = [ 96 "-Wall", 97 "-O2", 98 "-Wdate-time", 99 "-Wextra", 100 "-Wfloat-equal", 101 "-Wshadow", 102 ] 103 104 cflags_cc = cflags 105 } 106 } 107} else if (!support_jsapi) { 108 group("devicemanagerserviceimpl") { 109 deps = [] 110 } 111} else { 112 config("devicemanagerserviceimpl_config") { 113 include_dirs = [ 114 "include", 115 "include/config", 116 "include/adapter", 117 "include/attest", 118 "include/authentication", 119 "include/authentication_v2", 120 "include/ability", 121 "include/credential", 122 "include/cryptomgr", 123 "include/devicestate", 124 "include/dependency/commonevent", 125 "include/dependency/deviceprofile", 126 "include/dependency/multipleuser", 127 "include/dependency/hichain", 128 "include/dependency/softbus", 129 "include/dependency/MSDP", 130 "include/i18n", 131 "${common_path}/include", 132 "${common_path}/include/dfx", 133 "${common_path}/include/dfx/standard", 134 "${common_path}/include/ipc", 135 "${common_path}/include/ipc/model", 136 "${devicemanager_path}/commondependency/include", 137 "${devicemanager_path}/radar/include", 138 "${innerkits_path}/native_cpp/include", 139 "${utils_path}/include", 140 "${utils_path}/include/appInfo/standard", 141 "${utils_path}/include/crypto", 142 "${utils_path}/include/dfx", 143 "${utils_path}/include/dfx/standard", 144 "${utils_path}/include/fwkload/standard", 145 "${utils_path}/include/permission/standard", 146 "${utils_path}/include/timer", 147 "${json_path}/include", 148 "${services_path}/include", 149 "${services_path}/include/ipc/standard", 150 "${softbuscache_parh}/include", 151 ] 152 } 153 154 ohos_shared_library("devicemanagerserviceimpl") { 155 branch_protector_ret = "pac_ret" 156 157 sanitize = { 158 boundary_sanitize = true 159 cfi = true 160 cfi_cross_dso = true 161 debug = false 162 integer_overflow = true 163 ubsan = true 164 } 165 166 cflags = [ 167 "-Werror", 168 "-fPIC", 169 "-fstack-protector-strong", 170 ] 171 172 ldflags = [ 173 "-Wl,-z,relro", 174 "-Wl,-z,now", 175 ] 176 177 sources = [ 178 "src/ability/standard/dm_ability_manager.cpp", 179 "src/ability/standard/dm_dialog_manager.cpp", 180 "src/adapter/standard/dm_adapter_manager.cpp", 181 "src/attest/dm_auth_attest_common.cpp", 182 "src/attest/dm_auth_cert.cpp", 183 "src/authentication/auth_message_processor.cpp", 184 "src/authentication/auth_request_state.cpp", 185 "src/authentication/auth_response_state.cpp", 186 "src/authentication/auth_ui_state_manager.cpp", 187 "src/authentication/dm_auth_manager.cpp", 188 "src/authentication_v2/auth_manager.cpp", 189 "src/authentication_v2/auth_stages/auth_acl.cpp", 190 "src/authentication_v2/auth_stages/auth_confirm.cpp", 191 "src/authentication_v2/auth_stages/auth_credential.cpp", 192 "src/authentication_v2/auth_stages/auth_negotiate.cpp", 193 "src/authentication_v2/auth_stages/auth_pin_auth.cpp", 194 "src/authentication_v2/dm_auth_context.cpp", 195 "src/authentication_v2/dm_auth_manager_base.cpp", 196 "src/authentication_v2/dm_auth_message_processor.cpp", 197 "src/authentication_v2/dm_auth_state.cpp", 198 "src/authentication_v2/dm_auth_state_machine.cpp", 199 "src/authentication_v2/dm_negotiate_process.cpp", 200 "src/authentication_v2/dm_freeze_process.cpp", 201 "src/config/dm_config_manager.cpp", 202 "src/credential/dm_credential_manager.cpp", 203 "src/cryptomgr/crypto_mgr.cpp", 204 "src/dependency/commonevent/dm_common_event_manager.cpp", 205 "src/dependency/deviceprofile/dp_inited_callback.cpp", 206 "src/dependency/hichain/hichain_auth_connector.cpp", 207 "src/dependency/hichain/hichain_connector.cpp", 208 "src/dependency/hichain/mine_hichain_connector.cpp", 209 "src/dependency/softbus/softbus_connector.cpp", 210 "src/dependency/softbus/softbus_session.cpp", 211 "src/device_manager_service_impl.cpp", 212 "src/devicestate/dm_device_state_manager.cpp", 213 "src/i18n/dm_language_manager.cpp", 214 ] 215 216 public_configs = [ ":devicemanagerserviceimpl_config" ] 217 218 defines = [ 219 "HI_LOG_ENABLE", 220 "DH_LOG_TAG=\"devicemanagerserviceimpl\"", 221 "LOG_DOMAIN=0xD004110", 222 ] 223 224 deps = [ 225 "${devicemanager_path}/commondependency:devicemanagerdependency", 226 "${devicemanager_path}/radar:devicemanagerradar", 227 "${innerkits_path}/native_cpp:devicemanagersdk", 228 "${json_path}:devicemanagerjson", 229 "${softbuscache_parh}:dmdevicecache", 230 "${utils_path}:devicemanagerutils", 231 ] 232 233 external_deps = [ 234 "ability_base:session_info", 235 "ability_base:want", 236 "ability_runtime:ability_connect_callback_stub", 237 "ability_runtime:ability_manager", 238 "access_token:libaccesstoken_sdk", 239 "cJSON:cjson", 240 "c_utils:utils", 241 "common_event_service:cesfwk_innerkits", 242 "device_auth:deviceauth_sdk", 243 "device_info_manager:distributed_device_profile_common", 244 "device_info_manager:distributed_device_profile_sdk", 245 "dsoftbus:softbus_client", 246 "dsoftbus:softbus_utils", 247 "eventhandler:libeventhandler", 248 "ffrt:libffrt", 249 "hilog:libhilog", 250 "init:libbegetutil", 251 "ipc:ipc_core", 252 "mbedtls:mbedtls_shared", 253 "openssl:libcrypto_shared", 254 "os_account:libaccountkits", 255 "os_account:os_account_innerkits", 256 "power_manager:powermgr_client", 257 "resource_management:resmgr_napi_core", 258 "samgr:samgr_proxy", 259 "zlib:shared_libz", 260 ] 261 262 if (support_screenlock && device_manager_feature_product == "default") { 263 defines += [ "SUPPORT_SCREENLOCK" ] 264 external_deps += [ "screenlock_mgr:screenlock_client" ] 265 } 266 267 if (device_manager_common) { 268 defines += [ "DEVICE_MANAGER_COMMON_FLAG" ] 269 } 270 271 if (support_msdp) { 272 sources += [ "src/dependency/MSDP/spatial_location_callback_impl.cpp" ] 273 defines += [ "SUPPORT_MSDP" ] 274 external_deps += [ "spatial_awareness:spatial_awareness_client" ] 275 } 276 277 subsystem_name = "distributedhardware" 278 279 part_name = "device_manager" 280 } 281} 282