• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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}
19
20import("//foundation/distributedhardware/device_manager/device_manager.gni")
21
22if (defined(ohos_lite)) {
23  if (ohos_kernel_type == "linux") {
24    shared_library("devicemanagerserviceimpl") {
25      include_dirs = [
26        "include",
27        "include/ability",
28        "include/adapter",
29        "include/credential",
30        "include/dependency/hichain",
31        "include/dependency/softbus",
32        "include/devicestate",
33        "${common_path}/include",
34        "${common_path}/include/ipc",
35        "${common_path}/include/ipc/model",
36        "${common_path}/include/dfx",
37        "${common_path}/include/dfx/lite",
38        "${devicemanager_path}/commondependency/include",
39        "${innerkits_path}/native_cpp/include",
40        "${devicemanager_path}/radar/include",
41        "${utils_path}/include",
42        "${utils_path}/include/appInfo/lite",
43        "${utils_path}/include/crypto",
44        "${utils_path}/include/fwkload/lite",
45        "${utils_path}/include/timer/lite",
46        "//third_party/json/include",
47        "${services_path}/include",
48        "${services_path}/include/ipc/lite",
49        "${interfaces_path}/c/ipc/include",
50        "//foundation/communication/dsoftbus/interfaces/kits/bus_center",
51        "//foundation/communication/dsoftbus/interfaces/inner_kits/transport",
52        "//foundation/communication/dsoftbus/interfaces/kits/common",
53        "//foundation/communication/dsoftbus/interfaces/kits/transport",
54        "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr",
55        "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
56        "//commonlibrary/c_utils/base/include",
57        "${softbuscache_parh}/include",
58      ]
59
60      sources = [
61        "${devicemanager_path}/commondependency/src/multiple_user_connector.cpp",
62        "src/ability/lite/dm_ability_manager.cpp",
63        "src/adapter/lite/dm_adapter_manager.cpp",
64        "src/credential/dm_credential_manager.cpp",
65        "src/dependency/hichain/hichain_auth_connector.cpp",
66        "src/dependency/hichain/hichain_connector.cpp",
67        "src/dependency/hichain/mine_hichain_connector.cpp",
68        "src/dependency/softbus/softbus_connector.cpp",
69        "src/device_manager_service_impl_lite.cpp",
70        "src/devicestate/dm_device_state_manager.cpp",
71      ]
72
73      defines = [
74        "LITE_DEVICE",
75        "DH_LOG_ENABLE",
76        "DH_LOG_TAG=\"devicemanagerserviceimpl\"",
77        "LOG_DOMAIN=0xD004110",
78      ]
79
80      deps = [
81        "${devicemanager_path}/radar:devicemanagerradar",
82        "${softbuscache_parh}:dmdevicecache",
83        "${utils_path}:devicemanagerutils",
84        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
85        "//base/security/device_auth/services:deviceauth_sdk",
86        "//base/startup/init/interfaces/innerkits:libbegetutil",
87        "//commonlibrary/utils_lite:utils",
88        "//foundation/communication/dsoftbus:dsoftbus",
89        "//foundation/systemabilitymgr/safwk_lite:safwk_lite",
90        "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
91        "//third_party/bounds_checking_function:libsec_shared",
92      ]
93
94      cflags = [
95        "-Wall",
96        "-O2",
97        "-Wdate-time",
98        "-Wextra",
99        "-Wfloat-equal",
100        "-Wshadow",
101      ]
102
103      cflags_cc = cflags
104    }
105  }
106} else if (!support_jsapi) {
107  group("devicemanagerserviceimpl") {
108    deps = []
109  }
110} else {
111  config("devicemanagerserviceimpl_config") {
112    include_dirs = [
113      "include",
114      "include/config",
115      "include/adapter",
116      "include/authentication",
117      "include/authentication/showconfirm/standard",
118      "include/ability",
119      "include/credential",
120      "include/cryptomgr",
121      "include/devicestate",
122      "include/dependency/commonevent",
123      "include/dependency/deviceprofile",
124      "include/dependency/multipleuser",
125      "include/dependency/hichain",
126      "include/dependency/softbus",
127      "include/i18n",
128      "${common_path}/include",
129      "${common_path}/include/dfx",
130      "${common_path}/include/dfx/standard",
131      "${common_path}/include/ipc",
132      "${common_path}/include/ipc/model",
133      "${devicemanager_path}/commondependency/include",
134      "${devicemanager_path}/radar/include",
135      "${innerkits_path}/native_cpp/include",
136      "${utils_path}/include",
137      "${utils_path}/include/appInfo/standard",
138      "${utils_path}/include/crypto",
139      "${utils_path}/include/dfx",
140      "${utils_path}/include/dfx/standard",
141      "${utils_path}/include/fwkload/standard",
142      "${utils_path}/include/permission/standard",
143      "${utils_path}/include/timer",
144      "${services_path}/include",
145      "${services_path}/include/ipc/standard",
146      "${softbuscache_parh}/include",
147    ]
148  }
149
150  ohos_shared_library("devicemanagerserviceimpl") {
151    branch_protector_ret = "pac_ret"
152
153    sanitize = {
154      boundary_sanitize = true
155      cfi = true
156      cfi_cross_dso = true
157      debug = false
158      integer_overflow = true
159      ubsan = true
160    }
161
162    cflags = [
163      "-Werror",
164      "-fPIC",
165      "-fstack-protector-strong",
166    ]
167
168    ldflags = [
169      "-Wl,-z,relro",
170      "-Wl,-z,now",
171    ]
172
173    sources = [
174      "src/ability/standard/dm_ability_manager.cpp",
175      "src/ability/standard/dm_dialog_manager.cpp",
176      "src/adapter/standard/dm_adapter_manager.cpp",
177      "src/authentication/auth_message_processor.cpp",
178      "src/authentication/auth_request_state.cpp",
179      "src/authentication/auth_response_state.cpp",
180      "src/authentication/auth_ui_state_manager.cpp",
181      "src/authentication/dm_auth_manager.cpp",
182      "src/authentication/showconfirm/standard/show_confirm.cpp",
183      "src/config/dm_config_manager.cpp",
184      "src/credential/dm_credential_manager.cpp",
185      "src/cryptomgr/crypto_mgr.cpp",
186      "src/dependency/commonevent/dm_common_event_manager.cpp",
187      "src/dependency/deviceprofile/dp_inited_callback.cpp",
188      "src/dependency/hichain/hichain_auth_connector.cpp",
189      "src/dependency/hichain/hichain_connector.cpp",
190      "src/dependency/hichain/mine_hichain_connector.cpp",
191      "src/dependency/softbus/softbus_connector.cpp",
192      "src/dependency/softbus/softbus_session.cpp",
193      "src/device_manager_service_impl.cpp",
194      "src/devicestate/dm_device_state_manager.cpp",
195      "src/i18n/dm_language_manager.cpp",
196    ]
197
198    public_configs = [ ":devicemanagerserviceimpl_config" ]
199
200    defines = [
201      "HI_LOG_ENABLE",
202      "DH_LOG_TAG=\"devicemanagerserviceimpl\"",
203      "LOG_DOMAIN=0xD004110",
204    ]
205
206    deps = [
207      "${devicemanager_path}/commondependency:devicemanagerdependency",
208      "${devicemanager_path}/radar:devicemanagerradar",
209      "${innerkits_path}/native_cpp:devicemanagersdk",
210      "${softbuscache_parh}:dmdevicecache",
211      "${utils_path}:devicemanagerutils",
212    ]
213
214    external_deps = [
215      "ability_base:session_info",
216      "ability_base:want",
217      "ability_runtime:ability_connect_callback_stub",
218      "ability_runtime:ability_manager",
219      "access_token:libaccesstoken_sdk",
220      "bundle_framework:appexecfwk_base",
221      "bundle_framework:appexecfwk_core",
222      "cJSON:cjson",
223      "c_utils:utils",
224      "common_event_service:cesfwk_core",
225      "common_event_service:cesfwk_innerkits",
226      "device_auth:deviceauth_sdk",
227      "device_info_manager:distributed_device_profile_common",
228      "device_info_manager:distributed_device_profile_sdk",
229      "dsoftbus:softbus_client",
230      "eventhandler:libeventhandler",
231      "ffrt:libffrt",
232      "hilog:libhilog",
233      "init:libbegetutil",
234      "ipc:ipc_core",
235      "mbedtls:mbedtls_shared",
236      "openssl:libcrypto_shared",
237      "os_account:libaccountkits",
238      "resource_management:resmgr_napi_core",
239      "samgr:samgr_proxy",
240    ]
241
242    if (support_screenlock && device_manager_feature_product == "default") {
243      defines += [ "SUPPORT_SCREENLOCK" ]
244      external_deps += [ "screenlock_mgr:screenlock_client" ]
245    }
246
247    if (device_manager_common) {
248      defines += [ "DEVICE_MANAGER_COMMON_FLAG" ]
249    }
250
251    public_external_deps = [ "cJSON:cjson" ]
252
253    subsystem_name = "distributedhardware"
254
255    part_name = "device_manager"
256  }
257}
258