• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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")
20
21if (defined(ohos_lite)) {
22  if (ohos_kernel_type == "liteos_m") {
23    static_library("devicemanagersdk") {
24      include_dirs = [
25        "${innerkits_path}/native_cpp/include/mini",
26        "//third_party/cJSON",
27        "//kernel/liteos_m/kal/cmsis",
28        "//utils/native/lite/include",
29        "//kernel/liteos_m/kal/posix/include",
30        "//third_party/mbedtls/include",
31        "//third_party/mbedtls/include/mbedtls",
32        "//third_party/musl/porting/liteos_m/kernel/include",
33        "//device/bestechnic/bes2600w/sdk_liteos/bsp/platform/hal",
34        "//foundation/communication/wifi_lite/interfaces/wifiservice",
35        "//foundation/communication/dsoftbus/core/common/include",
36        "//foundation/communication/dsoftbus/interfaces/kits/bus_center",
37        "//foundation/communication/dsoftbus/interfaces/kits/common",
38        "//foundation/communication/dsoftbus/interfaces/kits/discovery",
39        "//foundation/communication/dsoftbus/interfaces/kits/transport",
40        "//foundation/communication/dsoftbus/interfaces/inner_kits/transport",
41        "//base/security/device_auth/interfaces/inner_api",
42        "//base/startup/init/interfaces/innerkits/include/syspara",
43      ]
44
45      sources = [
46        "${innerkits_path}/native_cpp/src/mini/device_manager_impl_lite_m.c",
47        "${innerkits_path}/native_cpp/src/mini/hichain_adapter.c",
48        "${innerkits_path}/native_cpp/src/mini/softbus_adapter.c",
49      ]
50
51      deps = [
52        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static",
53        "//commonlibrary/utils_lite:utils",
54        "//foundation/systemabilitymgr/samgr_lite/samgr",
55        "//third_party/bounds_checking_function:libsec_static",
56      ]
57
58      cflags = [
59        "-Wall",
60        "-O2",
61        "-std=c99",
62        "-Wdate-time",
63        "-Wextra",
64        "-Wfloat-equal",
65      ]
66      cflags_cc = cflags
67    }
68  } else {
69    shared_library("devicemanagersdk") {
70      include_dirs = [
71        "include",
72        "include/ipc",
73        "include/ipc/lite",
74        "include/notify",
75        "${common_path}/include",
76        "${common_path}/include/dfx",
77        "${common_path}/include/dfx/lite",
78        "${common_path}/include/ipc",
79        "${common_path}/include/ipc/lite",
80        "${common_path}/include/ipc/model",
81        "${interfaces_path}/c/ipc/include",
82        "${interfaces_path}/ipc_core/include",
83        "${samgr_lite_path}/kits/samgr",
84        "${samgr_lite_path}/kits/registry",
85        "${utils_lite_path}/include",
86        "//third_party/bounds_checking_function/include",
87        "//third_party/json/include",
88        "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
89        "${interfaces_path}/c/ipc/include",
90        "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr",
91        "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
92      ]
93
94      sources = [
95        "${common_path}/src/dfx/lite/dm_hidumper.cpp",
96        "${common_path}/src/dfx/lite/dm_hisysevent.cpp",
97        "${common_path}/src/dfx/lite/dm_hitrace.cpp",
98        "${common_path}/src/dm_anonymous.cpp",
99        "${common_path}/src/dm_log.cpp",
100        "src/device_manager.cpp",
101        "src/device_manager_impl.cpp",
102        "src/ipc/ipc_client_proxy.cpp",
103        "src/ipc/lite/ipc_client_manager.cpp",
104        "src/ipc/lite/ipc_client_server_proxy.cpp",
105        "src/ipc/lite/ipc_client_stub.cpp",
106        "src/ipc/lite/ipc_cmd_parser.cpp",
107        "src/notify/device_manager_notify.cpp",
108      ]
109
110      defines = [
111        "LITE_DEVICE",
112        "HI_LOG_ENABLE",
113        "DH_LOG_TAG=\"devicemanagerkit\"",
114        "LOG_DOMAIN=0xD004110",
115      ]
116
117      deps = [
118        "${utils_path}:devicemanagerutils",
119        "//base/security/device_auth/services:deviceauth_sdk",
120        "//base/startup/init/interfaces/innerkits:libbegetutil",
121        "//commonlibrary/utils_lite:utils",
122        "//foundation/communication/dsoftbus:dsoftbus",
123        "//foundation/systemabilitymgr/safwk_lite:safwk_lite",
124        "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
125        "//third_party/bounds_checking_function:libsec_shared",
126        "//third_party/mbedtls:mbedtls_shared",
127      ]
128    }
129  }
130} else {
131  config("devicemanagersdk_config") {
132    include_dirs = [
133      "include",
134      "include/ipc",
135      "include/ipc/standard",
136      "include/notify",
137      "${common_path}/include",
138      "${common_path}/include/ipc",
139      "${common_path}/include/ipc/model",
140      "${common_path}/include/ipc/standard",
141      "${common_path}/include/dfx",
142      "${common_path}/include/dfx/standard",
143      "//third_party/json/include",
144    ]
145  }
146
147  ohos_shared_library("devicemanagersdk") {
148    branch_protector_ret = "pac_ret"
149
150    sanitize = {
151      boundary_sanitize = true
152      integer_overflow = true
153      ubsan = true
154    }
155
156    sources = [
157      "${common_path}/src/dfx/standard/dm_hisysevent.cpp",
158      "${common_path}/src/dfx/standard/dm_hitrace.cpp",
159      "${common_path}/src/dm_anonymous.cpp",
160      "${common_path}/src/dm_log.cpp",
161      "${common_path}/src/ipc/standard/ipc_cmd_register.cpp",
162      "src/device_manager.cpp",
163      "src/device_manager_impl.cpp",
164      "src/ipc/ipc_client_proxy.cpp",
165      "src/ipc/standard/ipc_client_manager.cpp",
166      "src/ipc/standard/ipc_client_server_proxy.cpp",
167      "src/ipc/standard/ipc_client_stub.cpp",
168      "src/ipc/standard/ipc_cmd_parser.cpp",
169      "src/notify/device_manager_notify.cpp",
170    ]
171
172    public_configs = [ ":devicemanagersdk_config" ]
173
174    innerapi_tags = [ "platformsdk" ]
175
176    defines = [
177      "HI_LOG_ENABLE",
178      "DH_LOG_TAG=\"devicemanagerkit\"",
179      "LOG_DOMAIN=0xD004110",
180    ]
181
182    external_deps = [
183      "access_token:libaccesstoken_sdk",
184      "c_utils:utils",
185      "hilog:libhilog",
186      "hisysevent:libhisysevent",
187      "hitrace:hitrace_meter",
188      "ipc:ipc_core",
189      "ipc:ipc_napi",
190      "ipc:ipc_single",
191      "ipc:libdbinder",
192      "samgr:samgr_proxy",
193    ]
194
195    subsystem_name = "distributedhardware"
196
197    part_name = "device_manager"
198  }
199}
200