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("devicemanagerutils_mini") { 25 include_dirs = [ 26 "${utils_path}/include", 27 "${utils_path}/include/crypto", 28 "${utils_path}/include/dfx", 29 "${utils_path}/include/dfx/lite", 30 "${utils_path}/include/permission/lite", 31 "${common_path}/include", 32 "${innerkits_path}/native_cpp/include", 33 "//third_party/json/include", 34 "//third_party/bounds_checking_function/include", 35 ] 36 37 sources = [ 38 "${utils_path}/src/crypto/dm_crypto.cpp", 39 "${utils_path}/src/dm_anonymous.cpp", 40 "${utils_path}/src/dm_error_message.cpp", 41 "${utils_path}/src/dm_log.cpp", 42 "${utils_path}/src/dm_random.cpp", 43 ] 44 45 defines = [ 46 "__LITEOS_M__", 47 "HI_LOG_ENABLE", 48 "DH_LOG_TAG=\"devicemanagerutils\"", 49 "LOG_DOMAIN=0xD004100", 50 ] 51 52 deps = [ 53 "//third_party/bounds_checking_function:libsec_static", 54 "//third_party/mbedtls:mbedtls_shared", 55 "//third_party/openssl:libcrypto_shared", 56 ] 57 58 external_deps = [ 59 "device_auth:deviceauth_sdk", 60 "hilog_lite:hilog_static", 61 "init:libbegetutil", 62 "safwk:system_ability_fwk", 63 "utils_lite:utils", 64 ] 65 } 66 } else { 67 shared_library("devicemanagerutils") { 68 include_dirs = [ 69 "include", 70 "include/crypto", 71 "include/fwkload/lite", 72 "include/appInfo/lite", 73 "${common_path}/include", 74 "${common_path}/include/ipc", 75 "${common_path}/include/ipc/lite", 76 "${common_path}/include/ipc/model", 77 "${common_path}/include/dfx", 78 "${common_path}/include/dfx/lite", 79 "${innerkits_path}/native_cpp/include", 80 "${interfaces_path}/c/ipc/include", 81 "//third_party/json/include", 82 "//third_party/bounds_checking_function/include", 83 ] 84 85 sources = [ 86 "${common_path}/src/dfx/lite/dm_hidumper.cpp", 87 "${common_path}/src/dfx/lite/dm_hisysevent.cpp", 88 "${common_path}/src/dfx/lite/dm_hitrace.cpp", 89 "${common_path}/src/dm_anonymous.cpp", 90 "${common_path}/src/dm_error_message.cpp", 91 "${common_path}/src/dm_log.cpp", 92 "${common_path}/src/ipc/lite/ipc_cmd_register.cpp", 93 "src/appInfo/lite/app_manager.cpp", 94 "src/crypto/dm_crypto.cpp", 95 "src/dm_random.cpp", 96 "src/fwkload/lite/dm_distributed_hardware_load.cpp", 97 ] 98 99 defines = [ 100 "LITE_DEVICE", 101 "hI_LOG_ENABLE", 102 "DH_LOG_TAG=\"devicemanagerutils\"", 103 "lOG_DOMAIN=0xD004100", 104 ] 105 106 deps = [ 107 "//third_party/bounds_checking_function:libsec_shared", 108 "//third_party/mbedtls:mbedtls_shared", 109 "//third_party/openssl:libcrypto_shared", 110 ] 111 } 112 } 113} else { 114 config("devicemanagerutils_config") { 115 include_dirs = [ 116 "include", 117 "include/crypto", 118 "include/fwkload/standard", 119 "include/appInfo/standard", 120 "${common_path}/include", 121 "${common_path}/include/ipc", 122 "${common_path}/include/ipc/model", 123 "${common_path}/include/ipc/standard", 124 "${common_path}/include/dfx", 125 "${common_path}/include/dfx/standard", 126 "${innerkits_path}/native_cpp/include", 127 "//third_party/mbedtls/include/mbedtls", 128 "//third_party/json/include", 129 ] 130 } 131 132 ohos_shared_library("devicemanagerutils") { 133 sources = [ 134 "${common_path}/src/dfx/standard/dm_hidumper.cpp", 135 "${common_path}/src/dfx/standard/dm_hisysevent.cpp", 136 "${common_path}/src/dfx/standard/dm_hitrace.cpp", 137 "${common_path}/src/dm_anonymous.cpp", 138 "${common_path}/src/dm_error_message.cpp", 139 "${common_path}/src/dm_log.cpp", 140 "${common_path}/src/ipc/standard/ipc_cmd_register.cpp", 141 "src/appInfo/standard/app_manager.cpp", 142 "src/crypto/dm_crypto.cpp", 143 "src/dm_random.cpp", 144 ] 145 146 if (support_jsapi) { 147 sources += [ "src/fwkload/standard/dm_distributed_hardware_load.cpp" ] 148 } 149 150 public_configs = [ ":devicemanagerutils_config" ] 151 152 defines = [ 153 "HI_LOG_ENABLE", 154 "DH_LOG_TAG=\"devicemanagerutils\"", 155 "LOG_DOMAIN=0xD004100", 156 ] 157 158 deps = [ 159 "//third_party/mbedtls:mbedtls_shared", 160 "//third_party/openssl:libcrypto_shared", 161 ] 162 163 external_deps = [ 164 "ability_base:want", 165 "access_token:libaccesstoken_sdk", 166 "bundle_framework:appexecfwk_base", 167 "c_utils:utils", 168 "hilog:libhilog", 169 "hisysevent:libhisysevent", 170 "hitrace:hitrace_meter", 171 "ipc:ipc_core", 172 "ipc:ipc_single", 173 "samgr:samgr_proxy", 174 ] 175 176 if (support_jsapi) { 177 external_deps += [ "bundle_framework:appexecfwk_core" ] 178 } 179 180 subsystem_name = "distributedhardware" 181 182 part_name = "device_manager" 183 } 184} 185