# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/filemanagement/app_file_service/backup.gni") config("utils_private_config") { defines = [ "LOG_DOMAIN=0xD004305", "LOG_TAG=\"BackupUtils\"", ] } config("utils_public_config") { include_dirs = [ "include", "include/b_hilog", "${path_base}/include", ] } rust_cxx("backup_cxx_gen") { sources = [ "rust/src/lib.rs" ] } ohos_rust_static_ffi("backup_cxx_rust") { sources = [ "rust/src/lib.rs" ] deps = [ "//third_party/rust/crates/cxx:lib" ] part_name = "app_file_service" subsystem_name = "filemanagement" } ohos_static_library("backup_cxx_cppdeps") { part_name = "app_file_service" subsystem_name = "filemanagement" defines = [ "RUST_CXX_NO_EXCEPTIONS" ] sources = [ "//third_party/rust/crates/cxx/include/cxx.h", "//third_party/rust/crates/cxx/src/cxx.cc", ] deps = [ "//third_party/rust/crates/cxx:lib" ] if (is_win) { defines += [ "CXX_RS_EXPORT=__declspec(dllexport)" ] } else { defines += [ "CXX_RS_EXPORT=__attribute__((visibility(\"default\")))" ] } } ohos_shared_library("backup_utils") { sources = [ "src/b_encryption/b_encryption.cpp", "src/b_error/b_error.cpp", "src/b_error/b_excep_utils.cpp", "src/b_filesystem/b_dir.cpp", "src/b_filesystem/b_file.cpp", "src/b_json/b_json_entity_ext_manage.cpp", "src/b_json/b_json_entity_extension_config.cpp", "src/b_ohos/startup/backup_para.cpp", "src/b_process/b_guard_cwd.cpp", "src/b_process/b_guard_signal.cpp", "src/b_process/b_process.cpp", "src/b_tarball/b_tarball_cmdline.cpp", "src/b_tarball/b_tarball_factory.cpp", ] sources += get_target_outputs(":backup_cxx_gen") configs = [ ":utils_private_config" ] public_configs = [ ":utils_public_config" ] external_deps = [ "c_utils:utils", "faultloggerd:libdfx_dumpcatcher", "hilog:libhilog", "init:libbegetutil", ] include_dirs = [ "${path_init}/interfaces/innerkits/include/syspara", "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl", "${path_rust}/crates/cxx/include", "${target_gen_dir}/rust/src", ] deps = [ ":backup_cxx_cppdeps", ":backup_cxx_gen", ":backup_cxx_rust", "${path_jsoncpp}:jsoncpp", ] use_exceptions = true innerapi_tags = [ "platformsdk" ] part_name = "app_file_service" subsystem_name = "filemanagement" }