# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") } else { import("//build/ohos.gni") } import("//foundation/distributedhardware/device_manager/device_manager.gni") if (defined(ohos_lite)) { if (ohos_kernel_type == "liteos_m") { static_library("devicemanagersdk_mini") { include_dirs = [ "${innerkits_path}/native_cpp/include", "${innerkits_path}/native_cpp/include/notify", "${common_path}/include", "${common_path}/include/ipc", "${common_path}/include/ipc/model", "${samgr_lite_path}/kits/samgr", "${servicesimpl_path}/include/dispatch", "//third_party/bounds_checking_function/include", "//third_party/json/include", ] sources = [ "${innerkits_path}/native_cpp/src/mini/device_manager.cpp", "${innerkits_path}/native_cpp/src/mini/device_manager_impl.cpp", "${innerkits_path}/native_cpp/src/mini/device_manager_notify.cpp", ] defines = [ "__LITEOS_M__", "HI_LOG_ENABLE", "DH_LOG_TAG=\"devicemanagerkit\"", "LOG_DOMAIN=0xD004100", ] deps = [ "//third_party/bounds_checking_function:libsec_static" ] external_deps = [ "hilog_lite:hilog_static", "ipc:ipc_single", "napi:ace_napi", "utils_lite:utils", ] } } else { shared_library("devicemanagersdk") { include_dirs = [ "include", "include/ipc", "include/ipc/lite", "include/notify", "${common_path}/include", "${common_path}/include/ipc", "${common_path}/include/ipc/lite", "${common_path}/include/ipc/model", "${common_path}/include/dfx", "${common_path}/include/dfx/lite", "${interfaces_path}/c/ipc/include", "${interfaces_path}/ipc_core/include", "${samgr_lite_path}/kits/samgr", "${samgr_lite_path}/kits/registry", "${utils_lite_path}/include", "//third_party/bounds_checking_function/include", "//third_party/json/include", ] sources = [ "src/device_manager.cpp", "src/device_manager_impl.cpp", "src/ipc/ipc_client_proxy.cpp", "src/ipc/lite/ipc_client_manager.cpp", "src/ipc/lite/ipc_client_server_proxy.cpp", "src/ipc/lite/ipc_client_stub.cpp", "src/ipc/lite/ipc_cmd_parser.cpp", "src/notify/device_manager_notify.cpp", ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] defines = [ "LITE_DEVICE", "HI_LOG_ENABLE", "DH_LOG_TAG=\"devicemanagerkit\"", "LOG_DOMAIN=0xD004100", ] } } } else { config("devicemanagersdk_config") { include_dirs = [ "include", "include/ipc", "include/ipc/standard", "include/notify", "${common_path}/include", "${common_path}/include/ipc", "${common_path}/include/ipc/model", "${common_path}/include/ipc/standard", "${common_path}/include/dfx", "${common_path}/include/dfx/standard", "//third_party/json/include", ] } ohos_shared_library("devicemanagersdk") { sources = [ "${common_path}/src/dfx/standard/dm_hisysevent.cpp", "${common_path}/src/dfx/standard/dm_hitrace.cpp", "${common_path}/src/dm_anonymous.cpp", "${common_path}/src/dm_log.cpp", "${common_path}/src/ipc/standard/ipc_cmd_register.cpp", "src/device_manager.cpp", "src/device_manager_impl.cpp", "src/ipc/ipc_client_proxy.cpp", "src/ipc/standard/ipc_client_manager.cpp", "src/ipc/standard/ipc_client_server_proxy.cpp", "src/ipc/standard/ipc_client_stub.cpp", "src/ipc/standard/ipc_cmd_parser.cpp", "src/notify/device_manager_notify.cpp", ] public_configs = [ ":devicemanagersdk_config" ] innerapi_tags = [ "platformsdk" ] defines = [ "HI_LOG_ENABLE", "DH_LOG_TAG=\"devicemanagerkit\"", "LOG_DOMAIN=0xD004100", ] external_deps = [ "access_token:libaccesstoken_sdk", "c_utils:utils", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", "ipc:ipc_napi_common", "ipc:ipc_single", "ipc:libdbinder", "samgr:samgr_proxy", ] subsystem_name = "distributedhardware" part_name = "device_manager" } }