1# Copyright (c) 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") 20if (defined(ohos_lite)) { 21 if (ohos_kernel_type == "linux") { 22 shared_library("devicemanagerradar") { 23 include_dirs = [ 24 "include", 25 "${common_path}/include", 26 "${innerkits_path}/native_cpp/include", 27 "${c_utils_path}/include", 28 "//third_party/cJSON", 29 ] 30 31 sources = [ "src/lite/dm_radar_helper.cpp" ] 32 33 defines = [ 34 "LITE_DEVICE", 35 "DH_LOG_TAG=\"devicemanagerradar\"", 36 "LOG_DOMAIN=0xD004110", 37 ] 38 39 deps = [ 40 "${innerkits_path}/native_cpp:devicemanagersdk", 41 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 42 "//base/startup/init/interfaces/innerkits:libbegetutil", 43 "//commonlibrary/utils_lite:utils", 44 "//third_party/bounds_checking_function:libsec_shared", 45 ] 46 } 47 } 48} else { 49 ohos_shared_library("devicemanagerradar") { 50 include_dirs = [ 51 "include", 52 "${common_path}/include", 53 "${innerkits_path}/native_cpp/include", 54 ] 55 56 cflags = [ 57 "-Werror", 58 "-fPIC", 59 "-fstack-protector-strong", 60 ] 61 62 ldflags = [ 63 "-Wl,-z,relro", 64 "-Wl,-z,now", 65 ] 66 67 sources = [ "src/dm_radar_helper.cpp" ] 68 69 defines = [ 70 "HI_LOG_ENABLE", 71 "DH_LOG_TAG=\"devicemanagerradar\"", 72 "LOG_DOMAIN=0xD004110", 73 ] 74 75 deps = [ "${innerkits_path}/native_cpp:devicemanagersdk" ] 76 77 external_deps = [ 78 "access_token:libaccesstoken_sdk", 79 "access_token:libtokenid_sdk", 80 "cJSON:cjson", 81 "c_utils:utils", 82 "hilog:libhilog", 83 "hisysevent:libhisysevent", 84 "init:libbegetutil", 85 "ipc:ipc_core", 86 "ipc:ipc_single", 87 ] 88 89 subsystem_name = "distributedhardware" 90 91 part_name = "device_manager" 92 } 93} 94