• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023 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")
15
16libfuse_source = [
17  "//third_party/libfuse/lib/fuse.c",
18  "//third_party/libfuse/lib/fuse_loop.c",
19  "//third_party/libfuse/lib/fuse_loop_mt.c",
20  "//third_party/libfuse/lib/fuse_lowlevel.c",
21  "//third_party/libfuse/lib/fuse_opt.c",
22  "//third_party/libfuse/lib/fuse_signals.c",
23  "//third_party/libfuse/lib/buffer.c",
24  "//third_party/libfuse/lib/compat.c",
25  "//third_party/libfuse/lib/cuse_lowlevel.c",
26  "//third_party/libfuse/lib/helper.c",
27  "//third_party/libfuse/lib/modules/subdir.c",
28  "//third_party/libfuse/lib/mount_util.c",
29  "//third_party/libfuse/lib/fuse_log.c",
30  "//third_party/libfuse/lib/mount.c",
31  "//third_party/libfuse/lib/modules/iconv.c",
32]
33
34import("//build/ohos.gni")
35
36config("libfuse_public_config") {
37  visibility = [ ":*" ]
38
39  include_dirs = [
40    "//third_party/libfuse/include",
41    "//third_party/libfuse/lib",
42    "//third_party/libfuse/util",
43    "//third_party/libfuse/example",
44  ]
45}
46
47config("libfuse_config") {
48  visibility = [ ":*" ]
49
50  include_dirs = [
51    "//third_party/libfuse/include",
52    "//third_party/libfuse/lib",
53    "//third_party/libfuse",
54  ]
55
56  cflags = [
57    "-fdiagnostics-color=always",
58    "-pipe",
59    "-D_FILE_OFFSET_BITS=64",
60    "-Winvalid-pch",
61    "-Wextra",
62    "-O2",
63    "-g",
64    "-D_REENTRANT",
65    "-Wno-sign-compare",
66    "-Wmissing-declarations",
67    "-Wwrite-strings",
68    "-Wno-unused-result",
69    "-DFUSE_USE_VERSION=312",
70    "-DFUSERMOUNT_DIR=\"/usr/local/bin\"",
71    "-U_GNU_SOURCE",
72    "-pthread",
73  ]
74}
75
76ohos_shared_library("libfuse") {
77  configs = [ "//third_party/libfuse:libfuse_config" ]
78  public_configs = [ ":libfuse_public_config" ]
79  sources = libfuse_source
80  license_file = "./LGPL2.txt"
81  ldflags = [
82    "-ldl",
83    "-Wl,--version-script",
84    rebase_path("//third_party/libfuse/lib/fuse_versionscript", root_build_dir),
85    "-Wl,-soname,libfuse3.so.3",
86    "-Wl,--no-undefined",
87    "-Wl,--as-needed",
88    "-shared",
89    "-fPIC",
90  ]
91  innerapi_tags = [ "platformsdk" ]
92  external_deps = [ "c_utils:utils" ]
93  subsystem_name = "thirdparty"
94  part_name = "libfuse"
95  output_name = "libfuse"
96  install_enable = true
97  install_images = [ "system" ]
98}
99