• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/file_api/file_api.gni")
16
17config("libfs_public_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    "include",
22    "${utils_path}/common/include",
23  ]
24}
25
26ohos_shared_library("filemgmt_libfs") {
27  cflags_cc = [ "-std=c++17" ]
28  if (!use_mingw_win && !use_mac) {
29    cflags = [
30      "-fdata-sections",
31      "-ffunction-sections",
32      "-Oz",
33    ]
34    cflags_cc += [
35      "-fvisibility-inlines-hidden",
36      "-Oz",
37    ]
38    branch_protector_ret = "pac_ret"
39    sanitize = {
40      integer_overflow = true
41      ubsan = true
42      boundary_sanitize = true
43      cfi = true
44      cfi_cross_dso = true
45      debug = false
46    }
47  }
48
49  sources = [ "src/fs_error.cpp" ]
50
51  if (use_mingw_win) {
52    defines = [ "WIN_PLATFORM" ]
53  }
54  if (use_mac) {
55    defines = [ "IOS_PLATFORM" ]
56  }
57
58  public_configs = [ ":libfs_public_config" ]
59
60  deps = [ "${utils_path}/filemgmt_libhilog:filemgmt_libhilog" ]
61
62  external_deps = [
63    "hilog:libhilog",
64    "libuv:uv",
65  ]
66
67  use_exceptions = true
68
69  subsystem_name = "filemanagement"
70  innerapi_tags = [ "platformsdk" ]
71  part_name = "file_api"
72}
73