• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/cJSON",
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    cflags = [
62      "-Werror",
63      "-fPIC",
64      "-fstack-protector-strong",
65    ]
66
67    ldflags = [
68      "-Wl,-z,relro",
69      "-Wl,-z,now",
70    ]
71
72    include_dirs = [
73      "include",
74      "${common_path}/include",
75      "${utils_path}/include/crypto",
76    ]
77
78    sources = [ "src/dm_softbus_cache.cpp" ]
79
80    defines = [
81      "HI_LOG_ENABLE",
82      "DH_LOG_TAG=\"dmdevicecache\"",
83      "LOG_DOMAIN=0xD004113",
84    ]
85
86    deps = [
87      "${innerkits_path}/native_cpp:devicemanagersdk",
88      "${utils_path}:devicemanagerutils",
89    ]
90
91    external_deps = [
92      "bounds_checking_function:libsec_shared",
93      "dsoftbus:softbus_client",
94      "hilog:libhilog",
95    ]
96
97    subsystem_name = "distributedhardware"
98
99    part_name = "device_manager"
100  }
101}
102