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} 19import("//foundation/distributedhardware/device_manager/device_manager.gni") 20 21if (defined(ohos_lite)) { 22 if (ohos_kernel_type == "liteos_m") { 23 static_library("devicemanagersdk") { 24 include_dirs = [ 25 "${innerkits_path}/native_cpp/include/mini", 26 "//third_party/cJSON", 27 "//kernel/liteos_m/kal/cmsis", 28 "//utils/native/lite/include", 29 "//kernel/liteos_m/kal/posix/include", 30 "//third_party/musl/porting/liteos_m/kernel/include", 31 "//device/bestechnic/bes2600w/sdk_liteos/bsp/platform/hal", 32 "//foundation/communication/wifi_lite/interfaces/wifiservice", 33 "//foundation/communication/dsoftbus/core/common/include", 34 "//foundation/communication/dsoftbus/interfaces/kits/bus_center", 35 "//foundation/communication/dsoftbus/interfaces/kits/common", 36 "//foundation/communication/dsoftbus/interfaces/kits/discovery", 37 "//foundation/communication/dsoftbus/interfaces/kits/transport", 38 "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", 39 "//base/security/device_auth/interfaces/inner_api", 40 "//base/startup/init/interfaces/innerkits/include/syspara", 41 ] 42 43 sources = [ 44 "${innerkits_path}/native_cpp/src/mini/device_manager_impl_lite_m.c", 45 "${innerkits_path}/native_cpp/src/mini/hichain_adapter.c", 46 "${innerkits_path}/native_cpp/src/mini/softbus_adapter.c", 47 ] 48 49 deps = [ 50 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static", 51 "//commonlibrary/utils_lite:utils", 52 "//foundation/systemabilitymgr/samgr_lite/samgr", 53 "//third_party/bounds_checking_function:libsec_static", 54 ] 55 56 cflags = [ 57 "-Wall", 58 "-O2", 59 "-std=c99", 60 "-Wdate-time", 61 "-Wextra", 62 "-Wfloat-equal", 63 ] 64 cflags_cc = cflags 65 } 66 } else { 67 shared_library("devicemanagersdk") { 68 include_dirs = [ 69 "include", 70 "include/ipc", 71 "include/ipc/lite", 72 "include/notify", 73 "${common_path}/include", 74 "${common_path}/include/dfx", 75 "${common_path}/include/dfx/lite", 76 "${common_path}/include/ipc", 77 "${common_path}/include/ipc/lite", 78 "${common_path}/include/ipc/model", 79 "${devicemanager_path}/radar/include", 80 "${interfaces_path}/c/ipc/include", 81 "${interfaces_path}/ipc_core/include", 82 "${samgr_lite_path}/kits/samgr", 83 "${samgr_lite_path}/kits/registry", 84 "${utils_lite_path}/include", 85 "//third_party/bounds_checking_function/include", 86 "//third_party/json/include", 87 "${interfaces_path}/c/ipc/include", 88 "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr", 89 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", 90 ] 91 92 sources = [ 93 "${common_path}/src/dfx/lite/dm_hidumper.cpp", 94 "${common_path}/src/dfx/lite/dm_hisysevent.cpp", 95 "${common_path}/src/dfx/lite/dm_hitrace.cpp", 96 "${common_path}/src/dm_anonymous.cpp", 97 "src/device_manager.cpp", 98 "src/device_manager_impl.cpp", 99 "src/ipc/ipc_client_proxy.cpp", 100 "src/ipc/lite/ipc_client_manager.cpp", 101 "src/ipc/lite/ipc_client_server_proxy.cpp", 102 "src/ipc/lite/ipc_client_stub.cpp", 103 "src/ipc/lite/ipc_cmd_parser.cpp", 104 "src/notify/device_manager_notify.cpp", 105 ] 106 107 defines = [ 108 "LITE_DEVICE", 109 "HI_LOG_ENABLE", 110 "DH_LOG_TAG=\"devicemanagerkit\"", 111 "LOG_DOMAIN=0xD004111", 112 ] 113 114 deps = [ 115 "${utils_path}:devicemanagerutils", 116 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 117 "//base/security/device_auth/services:deviceauth_sdk", 118 "//base/startup/init/interfaces/innerkits:libbegetutil", 119 "//commonlibrary/utils_lite:utils", 120 "//foundation/communication/dsoftbus:dsoftbus", 121 "//foundation/systemabilitymgr/safwk_lite:safwk_lite", 122 "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", 123 "//third_party/bounds_checking_function:libsec_shared", 124 ] 125 } 126 } 127} else { 128 config("devicemanagersdk_config") { 129 include_dirs = [ 130 "include", 131 "include/ipc", 132 "include/ipc/standard", 133 "include/notify", 134 "${common_path}/include", 135 "${common_path}/include/ipc", 136 "${common_path}/include/ipc/model", 137 "${common_path}/include/ipc/standard", 138 "${common_path}/include/dfx", 139 "${common_path}/include/dfx/standard", 140 "${devicemanager_path}/radar/include", 141 ] 142 } 143 144 ohos_shared_library("devicemanagersdk") { 145 branch_protector_ret = "pac_ret" 146 147 sanitize = { 148 boundary_sanitize = true 149 integer_overflow = true 150 ubsan = true 151 } 152 153 sources = [ 154 "${common_path}/src/dfx/standard/dm_hisysevent.cpp", 155 "${common_path}/src/dfx/standard/dm_hitrace.cpp", 156 "${common_path}/src/dm_anonymous.cpp", 157 "${common_path}/src/ipc/standard/ipc_cmd_register.cpp", 158 "${devicemanager_path}/radar/src/dm_radar_helper.cpp", 159 "src/device_manager.cpp", 160 "src/device_manager_impl.cpp", 161 "src/ipc/ipc_client_proxy.cpp", 162 "src/ipc/standard/dm_service_load.cpp", 163 "src/ipc/standard/ipc_client_manager.cpp", 164 "src/ipc/standard/ipc_client_server_proxy.cpp", 165 "src/ipc/standard/ipc_client_stub.cpp", 166 "src/ipc/standard/ipc_cmd_parser.cpp", 167 "src/notify/device_manager_notify.cpp", 168 ] 169 170 public_configs = [ ":devicemanagersdk_config" ] 171 172 innerapi_tags = [ "platformsdk" ] 173 174 defines = [ 175 "HI_LOG_ENABLE", 176 "DH_LOG_TAG=\"devicemanagerkit\"", 177 "LOG_DOMAIN=0xD004111", 178 ] 179 180 external_deps = [ 181 "access_token:libaccesstoken_sdk", 182 "access_token:libtokenid_sdk", 183 "cJSON:cjson", 184 "c_utils:utils", 185 "ffrt:libffrt", 186 "hilog:libhilog", 187 "hisysevent:libhisysevent", 188 "hitrace:hitrace_meter", 189 "init:libbegetutil", 190 "ipc:ipc_core", 191 "ipc:ipc_napi", 192 "ipc:ipc_single", 193 "ipc:libdbinder", 194 "openssl:libcrypto_shared", 195 "samgr:samgr_proxy", 196 ] 197 198 public_external_deps = [ "json:nlohmann_json_static" ] 199 200 subsystem_name = "distributedhardware" 201 202 part_name = "device_manager" 203 } 204} 205