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_mini") { 24 include_dirs = [ 25 "${innerkits_path}/native_cpp/include", 26 "${innerkits_path}/native_cpp/include/notify", 27 "${common_path}/include", 28 "${common_path}/include/ipc", 29 "${common_path}/include/ipc/model", 30 "${samgr_lite_path}/kits/samgr", 31 "${servicesimpl_path}/include/dispatch", 32 "//third_party/bounds_checking_function/include", 33 "//third_party/json/include", 34 ] 35 36 sources = [ 37 "${innerkits_path}/native_cpp/src/mini/device_manager.cpp", 38 "${innerkits_path}/native_cpp/src/mini/device_manager_impl.cpp", 39 "${innerkits_path}/native_cpp/src/mini/device_manager_notify.cpp", 40 ] 41 42 defines = [ 43 "__LITEOS_M__", 44 "HI_LOG_ENABLE", 45 "DH_LOG_TAG=\"devicemanagerkit\"", 46 "LOG_DOMAIN=0xD004100", 47 ] 48 49 deps = [ "//third_party/bounds_checking_function:libsec_static" ] 50 51 external_deps = [ 52 "hilog_lite:hilog_static", 53 "ipc:ipc_single", 54 "napi:ace_napi", 55 "utils_lite:utils", 56 ] 57 } 58 } else { 59 shared_library("devicemanagersdk") { 60 include_dirs = [ 61 "include", 62 "include/ipc", 63 "include/ipc/lite", 64 "include/notify", 65 "${common_path}/include", 66 "${common_path}/include/ipc", 67 "${common_path}/include/ipc/lite", 68 "${common_path}/include/ipc/model", 69 "${common_path}/include/dfx", 70 "${common_path}/include/dfx/lite", 71 "${interfaces_path}/c/ipc/include", 72 "${interfaces_path}/ipc_core/include", 73 "${samgr_lite_path}/kits/samgr", 74 "${samgr_lite_path}/kits/registry", 75 "${utils_lite_path}/include", 76 "//third_party/bounds_checking_function/include", 77 "//third_party/json/include", 78 ] 79 80 sources = [ 81 "src/device_manager.cpp", 82 "src/device_manager_impl.cpp", 83 "src/ipc/ipc_client_proxy.cpp", 84 "src/ipc/lite/ipc_client_manager.cpp", 85 "src/ipc/lite/ipc_client_server_proxy.cpp", 86 "src/ipc/lite/ipc_client_stub.cpp", 87 "src/ipc/lite/ipc_cmd_parser.cpp", 88 "src/notify/device_manager_notify.cpp", 89 ] 90 91 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 92 93 defines = [ 94 "LITE_DEVICE", 95 "HI_LOG_ENABLE", 96 "DH_LOG_TAG=\"devicemanagerkit\"", 97 "LOG_DOMAIN=0xD004100", 98 ] 99 } 100 } 101} else { 102 config("devicemanagersdk_config") { 103 include_dirs = [ 104 "include", 105 "include/ipc", 106 "include/ipc/standard", 107 "include/notify", 108 "${common_path}/include", 109 "${common_path}/include/ipc", 110 "${common_path}/include/ipc/model", 111 "${common_path}/include/ipc/standard", 112 "${common_path}/include/dfx", 113 "${common_path}/include/dfx/standard", 114 "//third_party/json/include", 115 ] 116 } 117 118 ohos_shared_library("devicemanagersdk") { 119 sources = [ 120 "${common_path}/src/dfx/standard/dm_hisysevent.cpp", 121 "${common_path}/src/dfx/standard/dm_hitrace.cpp", 122 "${common_path}/src/dm_anonymous.cpp", 123 "${common_path}/src/dm_log.cpp", 124 "${common_path}/src/ipc/standard/ipc_cmd_register.cpp", 125 "src/device_manager.cpp", 126 "src/device_manager_impl.cpp", 127 "src/ipc/ipc_client_proxy.cpp", 128 "src/ipc/standard/ipc_client_manager.cpp", 129 "src/ipc/standard/ipc_client_server_proxy.cpp", 130 "src/ipc/standard/ipc_client_stub.cpp", 131 "src/ipc/standard/ipc_cmd_parser.cpp", 132 "src/notify/device_manager_notify.cpp", 133 ] 134 135 public_configs = [ ":devicemanagersdk_config" ] 136 137 innerapi_tags = [ "platformsdk" ] 138 139 defines = [ 140 "HI_LOG_ENABLE", 141 "DH_LOG_TAG=\"devicemanagerkit\"", 142 "LOG_DOMAIN=0xD004100", 143 ] 144 145 external_deps = [ 146 "access_token:libaccesstoken_sdk", 147 "c_utils:utils", 148 "hilog:libhilog", 149 "hisysevent:libhisysevent", 150 "hitrace:hitrace_meter", 151 "ipc:ipc_core", 152 "ipc:ipc_napi_common", 153 "ipc:ipc_single", 154 "ipc:libdbinder", 155 "samgr:samgr_proxy", 156 ] 157 158 subsystem_name = "distributedhardware" 159 160 part_name = "device_manager" 161 } 162} 163