• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-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
14import("//build/ohos.gni")
15import("//foundation/distributedhardware/device_manager/device_manager.gni")
16config("cflags_config") {
17  cflags = [
18    "-Werror",
19    "-fPIC",
20    "-fstack-protector-strong",
21    "-ffunction-sections",
22    "-fdata-sections",
23    "-fvisibility=hidden",
24    "-Oz",
25    "-flto",
26  ]
27  ldflags = [ "-flto" ]
28}
29ohos_shared_library("devicemanagerdependency") {
30  branch_protector_ret = "pac_ret"
31
32  sanitize = {
33    boundary_sanitize = true
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37    integer_overflow = true
38    ubsan = true
39  }
40
41  cflags = [
42    "-Werror",
43    "-fPIC",
44    "-fstack-protector-strong",
45  ]
46
47  ldflags = [
48    "-Wl,-z,relro",
49    "-Wl,-z,now",
50  ]
51
52  configs = [ ":cflags_config" ]
53
54  include_dirs = [
55    "include",
56    "${common_path}/include",
57    "${innerkits_path}/native_cpp/include",
58    "${servicesimpl_path}/include/cryptomgr",
59    "${utils_path}/include/crypto",
60  ]
61
62  sources = [
63    "src/deviceprofile_connector.cpp",
64    "src/multiple_user_connector.cpp",
65  ]
66
67  defines = [
68    "HI_LOG_ENABLE",
69    "DH_LOG_TAG=\"devicemanagerdependency\"",
70    "LOG_DOMAIN=0xD004112",
71  ]
72
73  deps = [
74    "${innerkits_path}/native_cpp:devicemanagersdk",
75    "${json_path}:devicemanagerjson",
76    "${utils_path}:devicemanagerutils",
77  ]
78
79  external_deps = [
80    "ability_base:want",
81    "c_utils:utils",
82    "device_info_manager:distributed_device_profile_common",
83    "device_info_manager:distributed_device_profile_sdk",
84    "eventhandler:libeventhandler",
85    "hilog:libhilog",
86    "init:libbegetutil",
87    "ipc:ipc_core",
88    "os_account:libaccountkits",
89    "samgr:samgr_proxy",
90  ]
91
92  if (os_account_part_exists) {
93    defines += [ "OS_ACCOUNT_PART_EXISTS" ]
94    external_deps += [ "os_account:os_account_innerkits" ]
95  }
96
97  subsystem_name = "distributedhardware"
98
99  part_name = "device_manager"
100}
101
102ohos_shared_library("devicemanagerdependencytest") {
103  branch_protector_ret = "pac_ret"
104
105  sanitize = {
106    boundary_sanitize = true
107    cfi = true
108    cfi_cross_dso = true
109    debug = false
110    integer_overflow = true
111    ubsan = true
112  }
113
114  cflags = [
115    "-Werror",
116    "-fPIC",
117    "-fstack-protector-strong",
118  ]
119
120  ldflags = [
121    "-Wl,-z,relro",
122    "-Wl,-z,now",
123  ]
124
125  include_dirs = [
126    "include",
127    "${common_path}/include",
128    "${innerkits_path}/native_cpp/include",
129    "${servicesimpl_path}/include/cryptomgr",
130    "${utils_path}/include/crypto",
131  ]
132
133  sources = [
134    "src/deviceprofile_connector.cpp",
135    "src/multiple_user_connector.cpp",
136  ]
137
138  defines = [
139    "HI_LOG_ENABLE",
140    "DH_LOG_TAG=\"devicemanagerdependency\"",
141    "LOG_DOMAIN=0xD004112",
142  ]
143
144  deps = [
145    "${innerkits_path}/native_cpp:devicemanagersdk",
146    "${json_path}:devicemanagerjson",
147    "${utils_path}:devicemanagerutils",
148  ]
149
150  external_deps = [
151    "ability_base:want",
152    "c_utils:utils",
153    "device_info_manager:distributed_device_profile_common",
154    "device_info_manager:distributed_device_profile_sdk",
155    "eventhandler:libeventhandler",
156    "hilog:libhilog",
157    "init:libbegetutil",
158    "ipc:ipc_core",
159    "os_account:libaccountkits",
160    "samgr:samgr_proxy",
161  ]
162
163  if (os_account_part_exists) {
164    defines += [ "OS_ACCOUNT_PART_EXISTS" ]
165    external_deps += [ "os_account:os_account_innerkits" ]
166  }
167
168  subsystem_name = "distributedhardware"
169
170  part_name = "device_manager"
171}
172