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 "${json_path}/include", 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 "${json_path}:devicemanagerjson", 42 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 43 "//base/startup/init/interfaces/innerkits:libbegetutil", 44 "//commonlibrary/utils_lite:utils", 45 "//third_party/bounds_checking_function:libsec_shared", 46 ] 47 } 48 } 49} else { 50 config("cflags_config") { 51 cflags = [ 52 "-Werror", 53 "-fPIC", 54 "-fstack-protector-strong", 55 "-ffunction-sections", 56 "-fdata-sections", 57 "-fvisibility=hidden", 58 "-Oz", 59 "-flto", 60 ] 61 ldflags = [ "-flto" ] 62 } 63 64 ohos_shared_library("devicemanagerradar") { 65 include_dirs = [ 66 "include", 67 "${common_path}/include", 68 "${innerkits_path}/native_cpp/include", 69 "${json_path}/include", 70 ] 71 72 sanitize = { 73 cfi = true 74 cfi_cross_dso = true 75 debug = false 76 } 77 78 cflags = [ 79 "-Werror", 80 "-fPIC", 81 "-fstack-protector-strong", 82 ] 83 84 ldflags = [ 85 "-Wl,-z,relro", 86 "-Wl,-z,now", 87 ] 88 89 configs = [ ":cflags_config" ] 90 91 sources = [ "src/dm_radar_helper.cpp" ] 92 93 defines = [ 94 "HI_LOG_ENABLE", 95 "DH_LOG_TAG=\"devicemanagerradar\"", 96 "LOG_DOMAIN=0xD004110", 97 ] 98 99 deps = [ 100 "${innerkits_path}/native_cpp:devicemanagersdk", 101 "${json_path}:devicemanagerjson", 102 ] 103 104 external_deps = [ 105 "access_token:libaccesstoken_sdk", 106 "access_token:libtokenid_sdk", 107 "cJSON:cjson", 108 "c_utils:utils", 109 "hilog:libhilog", 110 "hisysevent:libhisysevent", 111 "init:libbegetutil", 112 "ipc:ipc_core", 113 "ipc:ipc_single", 114 ] 115 116 subsystem_name = "distributedhardware" 117 118 part_name = "device_manager" 119 } 120 121 ohos_shared_library("devicemanagerradartest") { 122 include_dirs = [ 123 "include", 124 "${common_path}/include", 125 "${innerkits_path}/native_cpp/include", 126 "${json_path}/include", 127 ] 128 129 sanitize = { 130 cfi = true 131 cfi_cross_dso = true 132 debug = false 133 } 134 135 cflags = [ 136 "-Werror", 137 "-fPIC", 138 "-fstack-protector-strong", 139 ] 140 141 ldflags = [ 142 "-Wl,-z,relro", 143 "-Wl,-z,now", 144 ] 145 146 sources = [ "src/dm_radar_helper.cpp" ] 147 148 defines = [ 149 "HI_LOG_ENABLE", 150 "DH_LOG_TAG=\"devicemanagerradar\"", 151 "LOG_DOMAIN=0xD004110", 152 ] 153 154 deps = [ 155 "${innerkits_path}/native_cpp:devicemanagersdk", 156 "${json_path}:devicemanagerjson", 157 ] 158 159 external_deps = [ 160 "access_token:libaccesstoken_sdk", 161 "access_token:libtokenid_sdk", 162 "cJSON:cjson", 163 "c_utils:utils", 164 "hilog:libhilog", 165 "hisysevent:libhisysevent", 166 "init:libbegetutil", 167 "ipc:ipc_core", 168 "ipc:ipc_single", 169 ] 170 171 subsystem_name = "distributedhardware" 172 173 part_name = "device_manager" 174 } 175} 176