# 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") { include_dirs = [ "${innerkits_path}/native_cpp/include/mini", "//third_party/cJSON", "//kernel/liteos_m/kal/cmsis", "//utils/native/lite/include", "//kernel/liteos_m/kal/posix/include", "//third_party/musl/porting/liteos_m/kernel/include", "//device/bestechnic/bes2600w/sdk_liteos/bsp/platform/hal", "//foundation/communication/wifi_lite/interfaces/wifiservice", "//foundation/communication/dsoftbus/core/common/include", "//foundation/communication/dsoftbus/interfaces/kits/bus_center", "//foundation/communication/dsoftbus/interfaces/kits/common", "//foundation/communication/dsoftbus/interfaces/kits/discovery", "//foundation/communication/dsoftbus/interfaces/kits/transport", "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", "//base/security/device_auth/interfaces/inner_api", "//base/startup/init/interfaces/innerkits/include/syspara", ] sources = [ "${innerkits_path}/native_cpp/src/mini/device_manager_impl_lite_m.c", "${innerkits_path}/native_cpp/src/mini/hichain_adapter.c", "${innerkits_path}/native_cpp/src/mini/softbus_adapter.c", ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static", "//commonlibrary/utils_lite:utils", "//foundation/systemabilitymgr/samgr_lite/samgr", "//third_party/bounds_checking_function:libsec_static", ] cflags = [ "-Wall", "-O2", "-std=c99", "-Wdate-time", "-Wextra", "-Wfloat-equal", ] cflags_cc = cflags } } else { shared_library("devicemanagersdk") { include_dirs = [ "include", "include/ipc", "include/ipc/lite", "include/notify", "${common_path}/include", "${common_path}/include/dfx", "${common_path}/include/dfx/lite", "${common_path}/include/ipc", "${common_path}/include/ipc/lite", "${common_path}/include/ipc/model", "${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", "${interfaces_path}/c/ipc/include", "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr", "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", ] sources = [ "${common_path}/src/dfx/lite/dm_hidumper.cpp", "${common_path}/src/dfx/lite/dm_hisysevent.cpp", "${common_path}/src/dfx/lite/dm_hitrace.cpp", "${common_path}/src/dm_anonymous.cpp", "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", ] defines = [ "LITE_DEVICE", "HI_LOG_ENABLE", "DH_LOG_TAG=\"devicemanagerkit\"", "LOG_DOMAIN=0xD004111", ] deps = [ "${utils_path}:devicemanagerutils", "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//base/security/device_auth/services:deviceauth_sdk", "//base/startup/init/interfaces/innerkits:libbegetutil", "//commonlibrary/utils_lite:utils", "//foundation/communication/dsoftbus:dsoftbus", "//foundation/systemabilitymgr/safwk_lite:safwk_lite", "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", ] } } } 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", ] } ohos_shared_library("devicemanagersdk") { branch_protector_ret = "pac_ret" sanitize = { boundary_sanitize = true integer_overflow = true ubsan = true } 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/ipc/standard/ipc_cmd_register.cpp", "src/device_manager.cpp", "src/device_manager_impl.cpp", "src/ipc/ipc_client_proxy.cpp", "src/ipc/standard/dm_service_load.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=0xD004111", ] external_deps = [ "access_token:libaccesstoken_sdk", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", "ipc:ipc_napi", "ipc:ipc_single", "ipc:libdbinder", "samgr:samgr_proxy", ] public_external_deps = [ "json:nlohmann_json_static" ] subsystem_name = "distributedhardware" part_name = "device_manager" } }