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.
13import("//build/ohos.gni")
14import("//foundation/distributeddatamgr/udmf/udmf.gni")
15
16config("udmf_client_config") {
17  include_dirs = [
18    "${udmf_interfaces_path}/innerkits/client",
19    "${udmf_interfaces_path}/innerkits/common",
20    "${udmf_interfaces_path}/innerkits/data",
21    "${udmf_interfaces_path}/innerkits/convert",
22    "${udmf_interfaces_path}/ndk/data",
23    "${udmf_framework_path}/common",
24    "${udmf_framework_path}/innerkitsimpl/client",
25    "${udmf_framework_path}/innerkitsimpl/data",
26    "${udmf_framework_path}/innerkitsimpl/service",
27    "${udmf_framework_path}/innerkitsimpl/convert",
28    "${udmf_framework_path}/ndkimpl/data",
29    "${kv_store_path}/frameworks/common",
30    "//third_party/libuv/include",
31    "//third_party/node/src",
32    "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include",
33    "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/src",
34    "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include",
35    "${kv_store_path}/interfaces/innerkits/distributeddata/include",
36    "${file_service_path}/interfaces/common/include",
37    "${file_service_path}/interfaces/innerkits/native/file_uri/include",
38  ]
39}
40
41ohos_shared_library("udmf_client") {
42  branch_protector_ret = "pac_ret"
43  sanitize = {
44    ubsan = true
45    boundary_sanitize = true
46    cfi = true
47    cfi_cross_dso = true
48    debug = false
49  }
50  sources = [
51    "${udmf_framework_path}/common/endian_converter.cpp",
52    "${udmf_framework_path}/common/tlv_object.cpp",
53    "${udmf_framework_path}/common/tlv_util.cpp",
54    "${udmf_framework_path}/common/udmf_radar_reporter.cpp",
55    "${udmf_framework_path}/common/udmf_types_util.cpp",
56    "${udmf_framework_path}/common/udmf_utils.cpp",
57    "${udmf_framework_path}/innerkitsimpl/client/async_obtain_data.cpp",
58    "${udmf_framework_path}/innerkitsimpl/client/getter_system.cpp",
59    "${udmf_framework_path}/innerkitsimpl/client/udmf_client.cpp",
60    "${udmf_framework_path}/innerkitsimpl/common/unified_key.cpp",
61    "${udmf_framework_path}/innerkitsimpl/common/unified_meta.cpp",
62    "${udmf_framework_path}/innerkitsimpl/convert/ndk_data_conversion.cpp",
63    "${udmf_framework_path}/innerkitsimpl/convert/udmf_conversion.cpp",
64    "${udmf_framework_path}/innerkitsimpl/data/application_defined_record.cpp",
65    "${udmf_framework_path}/innerkitsimpl/data/audio.cpp",
66    "${udmf_framework_path}/innerkitsimpl/data/file.cpp",
67    "${udmf_framework_path}/innerkitsimpl/data/folder.cpp",
68    "${udmf_framework_path}/innerkitsimpl/data/html.cpp",
69    "${udmf_framework_path}/innerkitsimpl/data/image.cpp",
70    "${udmf_framework_path}/innerkitsimpl/data/link.cpp",
71    "${udmf_framework_path}/innerkitsimpl/data/plain_text.cpp",
72    "${udmf_framework_path}/innerkitsimpl/data/system_defined_appitem.cpp",
73    "${udmf_framework_path}/innerkitsimpl/data/system_defined_form.cpp",
74    "${udmf_framework_path}/innerkitsimpl/data/system_defined_pixelmap.cpp",
75    "${udmf_framework_path}/innerkitsimpl/data/system_defined_record.cpp",
76    "${udmf_framework_path}/innerkitsimpl/data/text.cpp",
77    "${udmf_framework_path}/innerkitsimpl/data/unified_data.cpp",
78    "${udmf_framework_path}/innerkitsimpl/data/unified_data_helper.cpp",
79    "${udmf_framework_path}/innerkitsimpl/data/unified_record.cpp",
80    "${udmf_framework_path}/innerkitsimpl/data/video.cpp",
81    "${udmf_framework_path}/innerkitsimpl/service/udmf_service_client.cpp",
82    "${udmf_framework_path}/innerkitsimpl/service/udmf_service_proxy.cpp",
83  ]
84
85  public_configs = [ ":udmf_client_config" ]
86
87  external_deps = [
88    "ability_base:zuri",
89    "access_token:libaccesstoken_sdk",
90    "app_file_service:fileuri_native",
91    "bundle_framework:appexecfwk_core",
92    "cJSON:cjson",
93    "c_utils:utils",
94    "hilog:libhilog",
95    "hisysevent:libhisysevent",
96    "hitrace:hitrace_meter",
97    "hitrace:libhitracechain",
98    "image_framework:image_native",
99    "ipc:ipc_core",
100    "kv_store:distributeddata_inner",
101    "kv_store:distributeddata_mgr",
102    "samgr:samgr_proxy",
103  ]
104
105  public_external_deps = [
106    "ability_base:want",
107    "cJSON:cjson",
108    "image_framework:image",
109  ]
110
111  innerapi_tags = [ "platformsdk" ]
112  subsystem_name = "distributeddatamgr"
113
114  part_name = "udmf"
115  use_exceptions = true
116  cflags_cc = [ "-fvisibility=hidden" ]
117}
118
119config("utd_client_config") {
120  include_dirs = [
121    "${udmf_interfaces_path}/innerkits/client",
122    "${udmf_interfaces_path}/innerkits/common",
123    "${udmf_interfaces_path}/innerkits/data",
124    "${udmf_framework_path}/common",
125    "${udmf_framework_path}/innerkitsimpl/data",
126    "${udmf_framework_path}/innerkitsimpl/service",
127  ]
128}
129
130ohos_shared_library("utd_client") {
131  branch_protector_ret = "pac_ret"
132  sanitize = {
133    cfi = true
134    cfi_cross_dso = true
135    debug = false
136  }
137
138  sources = [
139    "${udmf_framework_path}/common/base32_utils.cpp",
140    "${udmf_framework_path}/common/custom_utd_json_parser.cpp",
141    "${udmf_framework_path}/common/custom_utd_store.cpp",
142    "${udmf_framework_path}/common/graph.cpp",
143    "${udmf_framework_path}/common/udmf_utils.cpp",
144    "${udmf_framework_path}/common/utd_cfgs_checker.cpp",
145    "${udmf_framework_path}/common/utd_graph.cpp",
146    "${udmf_framework_path}/innerkitsimpl/client/utd_client.cpp",
147    "${udmf_framework_path}/innerkitsimpl/data/flexible_type.cpp",
148    "${udmf_framework_path}/innerkitsimpl/data/preset_type_descriptors.cpp",
149    "${udmf_framework_path}/innerkitsimpl/data/type_descriptor.cpp",
150  ]
151
152  public_configs = [ ":utd_client_config" ]
153
154  external_deps = [
155    "access_token:libaccesstoken_sdk",
156    "cJSON:cjson",
157    "c_utils:utils",
158    "hilog:libhilog",
159    "ipc:ipc_core",
160    "os_account:os_account_innerkits",
161  ]
162
163  public_external_deps = [ "cJSON:cjson" ]
164  use_exceptions = true
165  innerapi_tags = [ "platformsdk" ]
166  subsystem_name = "distributeddatamgr"
167
168  part_name = "udmf"
169  cflags_cc = [ "-fvisibility=hidden" ]
170  if (build_selinux) {
171    cflags = [ "-DWITH_SELINUX" ]
172    external_deps += [ "selinux_adapter:librestorecon" ]
173  }
174}
175