1# Copyright (c) 2024 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("dmdevicecache") { 23 include_dirs = [ 24 "include", 25 "${common_path}/include", 26 "${innerkits_path}/native_cpp/include", 27 "${utils_path}/include/crypto", 28 "//third_party/json/include", 29 ] 30 31 sources = [ 32 "${common_path}/src/dm_anonymous.cpp", 33 "src/dm_softbus_cache.cpp", 34 ] 35 36 defines = [ 37 "LITE_DEVICE", 38 "DH_LOG_TAG=\"dmdevicecache\"", 39 "LOG_DOMAIN=0xD004113", 40 ] 41 42 deps = [ 43 "${dsoftbussdk_path}:softbus_client", 44 "${hilog_path}:hilog_shared", 45 "${third_path}:libsec_shared", 46 "${utils_path}:devicemanagerutils", 47 ] 48 } 49 } 50} else { 51 ohos_shared_library("dmdevicecache") { 52 sanitize = { 53 boundary_sanitize = true 54 cfi = true 55 cfi_cross_dso = true 56 debug = false 57 integer_overflow = true 58 ubsan = true 59 } 60 61 include_dirs = [ 62 "include", 63 "${common_path}/include", 64 "${utils_path}/include/crypto", 65 ] 66 67 sources = [ 68 "${common_path}/src/dm_anonymous.cpp", 69 "src/dm_softbus_cache.cpp", 70 ] 71 72 defines = [ 73 "HI_LOG_ENABLE", 74 "DH_LOG_TAG=\"dmdevicecache\"", 75 "LOG_DOMAIN=0xD004113", 76 ] 77 78 deps = [ "${utils_path}:devicemanagerutils" ] 79 80 external_deps = [ 81 "bounds_checking_function:libsec_shared", 82 "dsoftbus:softbus_client", 83 "hilog:libhilog", 84 ] 85 86 subsystem_name = "distributedhardware" 87 88 part_name = "device_manager" 89 } 90} 91