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 == "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", 46 "//third_party/json/include", 47 "${services_path}/include", 48 "${services_path}/include/ipc/lite", 49 "${interfaces_path}/c/ipc/include", 50 "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr", 51 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", 52 "//commonlibrary/c_utils/base/include", 53 ] 54 55 sources = [ 56 "${common_path}/src/dm_softbus_adapter_crypto.cpp", 57 "${devicemanager_path}/commondependency/src/multiple_user_connector.cpp", 58 "src/ability/lite/dm_ability_manager.cpp", 59 "src/adapter/lite/dm_adapter_manager.cpp", 60 "src/credential/dm_credential_manager.cpp", 61 "src/dependency/hichain/hichain_auth_connector.cpp", 62 "src/dependency/hichain/hichain_connector.cpp", 63 "src/dependency/hichain/mine_hichain_connector.cpp", 64 "src/dependency/softbus/softbus_connector.cpp", 65 "src/device_manager_service_impl_lite.cpp", 66 "src/devicestate/dm_device_state_manager.cpp", 67 ] 68 69 defines = [ 70 "LITE_DEVICE", 71 "DH_LOG_ENABLE", 72 "DH_LOG_TAG=\"devicemanagerserviceimpl\"", 73 "LOG_DOMAIN=0xD004110", 74 ] 75 76 deps = [ 77 "${devicemanager_path}/radar:devicemanagerradar", 78 "${utils_path}:devicemanagerutils", 79 "//base/security/device_auth/services:deviceauth_sdk", 80 "//base/startup/init/interfaces/innerkits:libbegetutil", 81 "//commonlibrary/utils_lite:utils", 82 "//foundation/communication/dsoftbus:dsoftbus", 83 "//foundation/systemabilitymgr/safwk_lite:safwk_lite", 84 "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", 85 "//third_party/bounds_checking_function:libsec_shared", 86 "//third_party/mbedtls:mbedtls_shared", 87 ] 88 89 cflags = [ 90 "-Wall", 91 "-O2", 92 "-Wdate-time", 93 "-Wextra", 94 "-Wfloat-equal", 95 "-Wshadow", 96 ] 97 98 cflags_cc = cflags 99 } 100 } 101} else if (!support_jsapi) { 102 group("devicemanagerserviceimpl") { 103 deps = [] 104 } 105} else { 106 config("devicemanagerserviceimpl_config") { 107 include_dirs = [ 108 "include", 109 "include/config", 110 "include/adapter", 111 "include/authentication", 112 "include/authentication/showconfirm/standard", 113 "include/ability", 114 "include/credential", 115 "include/devicestate", 116 "include/discovery", 117 "include/publish", 118 "include/dependency/commonevent", 119 "include/dependency/deviceprofile", 120 "include/dependency/multipleuser", 121 "include/dependency/hichain", 122 "include/dependency/softbus", 123 "${common_path}/include", 124 "${common_path}/include/ipc", 125 "${common_path}/include/ipc/model", 126 "${devicemanager_path}/commondependency/include", 127 "${devicemanager_path}/radar/include", 128 "${utils_path}/include", 129 "${utils_path}/include/fwkload/standard", 130 "${utils_path}/include/dfx", 131 "${utils_path}/include/dfx/standard", 132 "${utils_path}/include/permission/standard", 133 "${utils_path}/include/timer", 134 "//third_party/json/include", 135 "${services_path}/include", 136 "${services_path}/include/ipc/standard", 137 ] 138 } 139 140 ohos_shared_library("devicemanagerserviceimpl") { 141 branch_protector_ret = "pac_ret" 142 143 sanitize = { 144 boundary_sanitize = true 145 cfi = true 146 cfi_cross_dso = true 147 debug = false 148 integer_overflow = true 149 ubsan = true 150 } 151 152 sources = [ 153 "${common_path}/src/dm_softbus_adapter_crypto.cpp", 154 "src/ability/standard/dm_ability_manager.cpp", 155 "src/ability/standard/dm_dialog_manager.cpp", 156 "src/adapter/standard/dm_adapter_manager.cpp", 157 "src/authentication/auth_message_processor.cpp", 158 "src/authentication/auth_request_state.cpp", 159 "src/authentication/auth_response_state.cpp", 160 "src/authentication/auth_ui_state_manager.cpp", 161 "src/authentication/dm_auth_manager.cpp", 162 "src/authentication/showconfirm/standard/show_confirm.cpp", 163 "src/config/dm_config_manager.cpp", 164 "src/credential/dm_credential_manager.cpp", 165 "src/dependency/commonevent/dm_common_event_manager.cpp", 166 "src/dependency/hichain/hichain_auth_connector.cpp", 167 "src/dependency/hichain/hichain_connector.cpp", 168 "src/dependency/hichain/mine_hichain_connector.cpp", 169 "src/dependency/softbus/softbus_connector.cpp", 170 "src/dependency/softbus/softbus_session.cpp", 171 "src/device_manager_service_impl.cpp", 172 "src/devicestate/dm_device_state_manager.cpp", 173 "src/discovery/dm_discovery_filter.cpp", 174 "src/discovery/dm_discovery_manager.cpp", 175 "src/publish/dm_publish_manager.cpp", 176 ] 177 178 public_configs = [ ":devicemanagerserviceimpl_config" ] 179 180 defines = [ 181 "HI_LOG_ENABLE", 182 "DH_LOG_TAG=\"devicemanagerserviceimpl\"", 183 "LOG_DOMAIN=0xD004110", 184 ] 185 186 deps = [ 187 "${devicemanager_path}/commondependency:devicemanagerdependency", 188 "${devicemanager_path}/radar:devicemanagerradar", 189 "${innerkits_path}/native_cpp:devicemanagersdk", 190 "${utils_path}:devicemanagerutils", 191 "//third_party/mbedtls:mbedtls_shared", 192 ] 193 194 external_deps = [ 195 "ability_base:want", 196 "ability_runtime:ability_manager", 197 "access_token:libaccesstoken_sdk", 198 "c_utils:utils", 199 "common_event_service:cesfwk_core", 200 "common_event_service:cesfwk_innerkits", 201 "device_auth:deviceauth_sdk", 202 "device_info_manager:distributed_device_profile_common", 203 "device_info_manager:distributed_device_profile_sdk", 204 "dsoftbus:softbus_client", 205 "hilog:libhilog", 206 "init:libbegetutil", 207 "ipc:ipc_core", 208 "os_account:libaccountkits", 209 "resource_management:resmgr_napi_core", 210 "samgr:samgr_proxy", 211 ] 212 213 subsystem_name = "distributedhardware" 214 215 part_name = "device_manager" 216 } 217} 218