• 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
14import("//build/ohos.gni")
15import("//foundation/filemanagement/app_file_service/backup.gni")
16
17config("utils_private_config") {
18  defines = [
19    "LOG_DOMAIN=0xD004305",
20    "LOG_TAG=\"BackupUtils\"",
21  ]
22}
23
24config("utils_public_config") {
25  include_dirs = [
26    "include",
27    "include/b_hilog",
28  ]
29}
30
31ohos_static_library("backup_cxx_cppdeps") {
32  branch_protector_ret = "pac_ret"
33
34  sanitize = {
35    integer_overflow = true
36    ubsan = true
37    boundary_sanitize = true
38    cfi = true
39    cfi_cross_dso = true
40    debug = false
41  }
42
43  part_name = "app_file_service"
44  subsystem_name = "filemanagement"
45}
46
47ohos_shared_library("backup_utils") {
48  branch_protector_ret = "pac_ret"
49
50  sanitize = {
51    integer_overflow = true
52    ubsan = true
53    boundary_sanitize = true
54    cfi = true
55    cfi_cross_dso = true
56    debug = false
57  }
58
59  sources = [
60    "src/b_anony/b_anony.cpp",
61    "src/b_encryption/b_encryption.cpp",
62    "src/b_error/b_error.cpp",
63    "src/b_error/b_excep_utils.cpp",
64    "src/b_filesystem/b_dir.cpp",
65    "src/b_filesystem/b_file.cpp",
66    "src/b_filesystem/b_file_hash.cpp",
67    "src/b_hiaudit/hi_audit.cpp",
68    "src/b_hiaudit/zip_util.cpp",
69    "src/b_json/b_json_clear_data_config.cpp",
70    "src/b_json/b_json_entity_ext_manage.cpp",
71    "src/b_json/b_json_entity_extension_config.cpp",
72    "src/b_json/b_json_service_disposal_config.cpp",
73    "src/b_json/b_report_entity.cpp",
74    "src/b_jsonutil/b_jsonutil.cpp",
75    "src/b_ohos/startup/backup_para.cpp",
76    "src/b_process/b_guard_cwd.cpp",
77    "src/b_process/b_guard_signal.cpp",
78    "src/b_process/b_process.cpp",
79    "src/b_radar/b_radar.cpp",
80    "src/b_radar/radar_app_statistic.cpp",
81    "src/b_radar/radar_total_statistic.cpp",
82    "src/b_sa/b_sa_utils.cpp",
83    "src/b_tarball/b_tarball_cmdline.cpp",
84    "src/b_tarball/b_tarball_factory.cpp",
85    "src/b_utils/b_time.cpp",
86    "src/b_utils/scan_file_singleton.cpp",
87  ]
88
89  configs = [
90    ":utils_private_config",
91    "${path_backup}/services/backup_sa:public_idl_config",
92  ]
93  public_configs = [ ":utils_public_config" ]
94
95  external_deps = [
96    "access_token:libaccesstoken_sdk",
97    "access_token:libtokenid_sdk",
98    "cJSON:cjson",
99    "c_utils:utils",
100    "faultloggerd:libdfx_dumpcatcher",
101    "hilog:libhilog",
102    "hisysevent:libhisysevent",
103    "hitrace:hitrace_meter",
104    "init:libbegetutil",
105    "ipc:ipc_core",
106    "jsoncpp:jsoncpp",
107    "openssl:libcrypto_shared",
108    "zlib:shared_libz",
109  ]
110
111  include_dirs = [
112    "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl",
113    "${path_backup}/utils/include",
114  ]
115
116  deps = [
117    ":backup_cxx_cppdeps",
118    "${path_backup}/interfaces/innerkits/native:sandbox_helper_native",
119    "${path_backup}/services/backup_sa:backup_idl",
120  ]
121
122  cflags_cc = [
123    "-fdata-sections",
124    "-ffunction-sections",
125    "-fno-unwind-tables",
126    "-fno-asynchronous-unwind-tables",
127    "-Os",
128  ]
129
130  use_exceptions = true
131  innerapi_tags = [ "platformsdk" ]
132  part_name = "app_file_service"
133  subsystem_name = "filemanagement"
134}
135