140f5d65dSopenharmony_ci# Copyright (C) 2024 Huawei Device Co., Ltd.
240f5d65dSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
340f5d65dSopenharmony_ci# you may not use this file except in compliance with the License.
440f5d65dSopenharmony_ci# You may obtain a copy of the License at
540f5d65dSopenharmony_ci#
640f5d65dSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
740f5d65dSopenharmony_ci#
840f5d65dSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
940f5d65dSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1040f5d65dSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1140f5d65dSopenharmony_ci# See the License for the specific language governing permissions and
1240f5d65dSopenharmony_ci# limitations under the License.
1340f5d65dSopenharmony_ci
1440f5d65dSopenharmony_ciimport("//build/ohos.gni")
1540f5d65dSopenharmony_ciimport("//foundation/filemanagement/app_file_service/app_file_service.gni")
1640f5d65dSopenharmony_ciimport("//foundation/filemanagement/app_file_service/backup.gni")
1740f5d65dSopenharmony_ci
1840f5d65dSopenharmony_ciohos_shared_library("cj_file_fileuri_ffi") {
1940f5d65dSopenharmony_ci  sanitize = {
2040f5d65dSopenharmony_ci    integer_overflow = true
2140f5d65dSopenharmony_ci    ubsan = true
2240f5d65dSopenharmony_ci    boundary_sanitize = true
2340f5d65dSopenharmony_ci    cfi = true
2440f5d65dSopenharmony_ci    cfi_cross_dso = true
2540f5d65dSopenharmony_ci    debug = false
2640f5d65dSopenharmony_ci  }
2740f5d65dSopenharmony_ci
2840f5d65dSopenharmony_ci  include_dirs = [
2940f5d65dSopenharmony_ci    "${app_file_service_path}/interfaces/innerkits/native/file_uri/include",
3040f5d65dSopenharmony_ci    "src",
3140f5d65dSopenharmony_ci  ]
3240f5d65dSopenharmony_ci
3340f5d65dSopenharmony_ci  if (!defined(defines)) {
3440f5d65dSopenharmony_ci    defines = []
3540f5d65dSopenharmony_ci  }
3640f5d65dSopenharmony_ci
3740f5d65dSopenharmony_ci  use_exceptions = true
3840f5d65dSopenharmony_ci
3940f5d65dSopenharmony_ci  if (product_name != "ohos-sdk") {
4040f5d65dSopenharmony_ci    deps = [
4140f5d65dSopenharmony_ci      "${app_file_service_path}/interfaces/innerkits/native:fileuri_native",
4240f5d65dSopenharmony_ci      "${path_backup}/utils:backup_utils",
4340f5d65dSopenharmony_ci    ]
4440f5d65dSopenharmony_ci    external_deps = [
4540f5d65dSopenharmony_ci      "ability_base:zuri",
4640f5d65dSopenharmony_ci      "ability_runtime:abilitykit_native",
4740f5d65dSopenharmony_ci      "bundle_framework:appexecfwk_base",
4840f5d65dSopenharmony_ci      "bundle_framework:appexecfwk_core",
4940f5d65dSopenharmony_ci      "c_utils:utils",
5040f5d65dSopenharmony_ci      "file_api:filemgmt_libhilog",
5140f5d65dSopenharmony_ci      "file_api:filemgmt_libn",
5240f5d65dSopenharmony_ci      "hilog:libhilog",
5340f5d65dSopenharmony_ci      "ipc:ipc_core",
5440f5d65dSopenharmony_ci      "napi:cj_bind_ffi",
5540f5d65dSopenharmony_ci      "napi:cj_bind_native",
5640f5d65dSopenharmony_ci      "samgr:samgr_proxy",
5740f5d65dSopenharmony_ci    ]
5840f5d65dSopenharmony_ci    sources = [
5940f5d65dSopenharmony_ci      "src/file_fileuri_ffi.cpp",
6040f5d65dSopenharmony_ci      "src/file_uri.cpp",
6140f5d65dSopenharmony_ci    ]
6240f5d65dSopenharmony_ci  } else {
6340f5d65dSopenharmony_ci    defines += [ "PREVIEWER" ]
6440f5d65dSopenharmony_ci    sources = [ "src/fileuri_mock.cpp" ]
6540f5d65dSopenharmony_ci  }
6640f5d65dSopenharmony_ci
6740f5d65dSopenharmony_ci  if (current_os == "ohos") {
6840f5d65dSopenharmony_ci    defines += [ "OHOS_PLATFORM" ]
6940f5d65dSopenharmony_ci  }
7040f5d65dSopenharmony_ci
7140f5d65dSopenharmony_ci  if (current_os == "mingw") {
7240f5d65dSopenharmony_ci    defines += [ "WINDOWS_PLATFORM" ]
7340f5d65dSopenharmony_ci  }
7440f5d65dSopenharmony_ci
7540f5d65dSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
7640f5d65dSopenharmony_ci  part_name = "app_file_service"
7740f5d65dSopenharmony_ci  subsystem_name = "filemanagement"
7840f5d65dSopenharmony_ci}
79