• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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_mini") {
24      include_dirs = [
25        "${innerkits_path}/native_cpp/include",
26        "${innerkits_path}/native_cpp/include/notify",
27        "${common_path}/include",
28        "${common_path}/include/ipc",
29        "${common_path}/include/ipc/model",
30        "${servicesimpl_path}/include/dispatch",
31      ]
32      include_dirs += [
33        "//commonlibrary/utils_lite/include",
34        "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
35        "//third_party/bounds_checking_function/include",
36        "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
37        "//third_party/json/include",
38      ]
39
40      sources = [
41        "${innerkits_path}/native_cpp/src/mini/device_manager.cpp",
42        "${innerkits_path}/native_cpp/src/mini/device_manager_impl.cpp",
43        "${innerkits_path}/native_cpp/src/mini/device_manager_notify.cpp",
44      ]
45
46      defines = [
47        "__LITEOS_M__",
48        "HI_LOG_ENABLE",
49        "DH_LOG_TAG=\"devicemanagerkit\"",
50        "LOG_DOMAIN=0xD004100",
51      ]
52
53      deps = [
54        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static",
55        "//commonlibrary/utils_lite:utils",
56        "//foundation/systemabilitymgr/samgr_lite/samgr",
57        "//third_party/bounds_checking_function:libsec_static",
58      ]
59    }
60  } else {
61    shared_library("devicemanagersdk") {
62      include_dirs = [
63        "include",
64        "include/ipc",
65        "include/ipc/lite",
66        "include/notify",
67        "${common_path}/include",
68        "${common_path}/include/ipc",
69        "${common_path}/include/ipc/lite",
70        "${common_path}/include/ipc/model",
71        "${common_path}/include/dfx",
72        "${common_path}/include/dfx/lite",
73      ]
74      include_dirs += [
75        "//commonlibrary/utils_lite/include",
76        "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
77        "//third_party/bounds_checking_function/include",
78        "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include",
79        "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
80        "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry",
81        "//third_party/json/include",
82      ]
83      sources = [
84        "src/device_manager.cpp",
85        "src/device_manager_impl.cpp",
86        "src/ipc/ipc_client_proxy.cpp",
87        "src/ipc/lite/ipc_client_manager.cpp",
88        "src/ipc/lite/ipc_client_server_proxy.cpp",
89        "src/ipc/lite/ipc_client_stub.cpp",
90        "src/ipc/lite/ipc_cmd_parser.cpp",
91        "src/notify/device_manager_notify.cpp",
92      ]
93      deps = [
94        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
95        "//commonlibrary/utils_lite:utils",
96        "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
97        "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
98        "//third_party/bounds_checking_function:libsec_shared",
99      ]
100      defines = [
101        "LITE_DEVICE",
102        "HI_LOG_ENABLE",
103        "DH_LOG_TAG=\"devicemanagerkit\"",
104        "LOG_DOMAIN=0xD004100",
105      ]
106    }
107  }
108} else {
109  config("devicemanagersdk_config") {
110    include_dirs = [
111      "include",
112      "include/ipc",
113      "include/ipc/standard",
114      "include/notify",
115      "${common_path}/include",
116      "${common_path}/include/ipc",
117      "${common_path}/include/ipc/model",
118      "${common_path}/include/ipc/standard",
119      "${common_path}/include/dfx",
120      "${common_path}/include/dfx/standard",
121      "//third_party/json/include",
122    ]
123  }
124
125  ohos_shared_library("devicemanagersdk") {
126    sources = [
127      "${common_path}/src/dfx/standard/dm_hisysevent.cpp",
128      "${common_path}/src/dfx/standard/dm_hitrace.cpp",
129      "${common_path}/src/dm_anonymous.cpp",
130      "${common_path}/src/dm_log.cpp",
131      "${common_path}/src/ipc/standard/ipc_cmd_register.cpp",
132      "src/device_manager.cpp",
133      "src/device_manager_impl.cpp",
134      "src/ipc/ipc_client_proxy.cpp",
135      "src/ipc/standard/ipc_client_manager.cpp",
136      "src/ipc/standard/ipc_client_server_proxy.cpp",
137      "src/ipc/standard/ipc_client_stub.cpp",
138      "src/ipc/standard/ipc_cmd_parser.cpp",
139      "src/notify/device_manager_notify.cpp",
140    ]
141
142    public_configs = [ ":devicemanagersdk_config" ]
143
144    defines = [
145      "HI_LOG_ENABLE",
146      "DH_LOG_TAG=\"devicemanagerkit\"",
147      "LOG_DOMAIN=0xD004100",
148    ]
149
150    external_deps = [
151      "c_utils:utils",
152      "hisysevent_native:libhisysevent",
153      "hitrace_native:hitrace_meter",
154      "hiviewdfx_hilog_native:libhilog",
155      "ipc:ipc_core",
156      "samgr:samgr_proxy",
157    ]
158
159    subsystem_name = "distributedhardware"
160
161    part_name = "device_manager"
162  }
163}
164