• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 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/devicemanager/devicemanager.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        "${utils_path}/include",
28        "${common_path}/include",
29        "${services_path}/include/dispatch",
30      ]
31      include_dirs += [
32        "//utils/native/lite/include",
33        "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
34        "//third_party/bounds_checking_function/include",
35        "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
36        "//third_party/json/include",
37      ]
38
39      sources = [
40        "${innerkits_path}/native_cpp/src/mini/device_manager.cpp",
41        "${innerkits_path}/native_cpp/src/mini/device_manager_impl.cpp",
42        "${innerkits_path}/native_cpp/src/mini/device_manager_notify.cpp",
43      ]
44
45      defines = [
46        "LITE_DEVICE",
47        "HI_LOG_ENABLE",
48        "DH_LOG_TAG=\"devicemanagerkit\"",
49        "LOG_DOMAIN=0xD004100",
50      ]
51
52      deps = [
53        "${utils_path}:devicemanagerutils_mini",
54        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static",
55        "//foundation/distributedschedule/samgr_lite/samgr",
56        "//third_party/bounds_checking_function:libsec_static",
57        "//utils/native/lite:utils",
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/model",
70        "${utils_path}/include",
71        "${utils_path}/include/ipc/lite",
72      ]
73      include_dirs += [
74        "//utils/native/lite/include",
75        "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
76        "//third_party/bounds_checking_function/include",
77        "//foundation/communication/ipc_lite/interfaces/kits",
78        "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
79        "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry",
80        "//third_party/json/include",
81        "//foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite/",
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        "${utils_path}:devicemanagerutils",
95        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
96        "//foundation/communication/ipc_lite:liteipc_adapter",
97        "//foundation/distributedschedule/samgr_lite/samgr:samgr",
98        "//third_party/bounds_checking_function:libsec_shared",
99        "//utils/native/lite:utils",
100      ]
101      defines = [
102        "LITE_DEVICE",
103        "HI_LOG_ENABLE",
104        "DH_LOG_TAG=\"devicemanagerkit\"",
105        "LOG_DOMAIN=0xD004100",
106      ]
107    }
108  }
109} else {
110  config("devicemanagersdk_config") {
111    include_dirs = [
112      "include",
113      "include/ipc",
114      "include/ipc/standard",
115      "include/notify",
116      "${common_path}/include",
117      "${common_path}/include/ipc",
118      "${common_path}/include/ipc/model",
119    ]
120  }
121
122  ohos_shared_library("devicemanagersdk") {
123    sources = [
124      "src/device_manager.cpp",
125      "src/device_manager_impl.cpp",
126      "src/ipc/ipc_client_proxy.cpp",
127      "src/ipc/standard/ipc_client_manager.cpp",
128      "src/ipc/standard/ipc_client_server_proxy.cpp",
129      "src/ipc/standard/ipc_client_stub.cpp",
130      "src/ipc/standard/ipc_cmd_parser.cpp",
131      "src/notify/device_manager_notify.cpp",
132    ]
133
134    public_configs = [ ":devicemanagersdk_config" ]
135
136    defines = [
137      "HI_LOG_ENABLE",
138      "DH_LOG_TAG=\"devicemanagerkit\"",
139      "LOG_DOMAIN=0xD004100",
140    ]
141
142    deps = [ "${utils_path}:devicemanagerutils" ]
143
144    external_deps = [
145      "hiviewdfx_hilog_native:libhilog",
146      "ipc:ipc_core",
147      "samgr_standard:samgr_proxy",
148      "utils_base:utils",
149    ]
150
151    subsystem_name = "distributedhardware"
152
153    part_name = "device_manager_base"
154  }
155}
156