b75d58ca创建于 25 天前历史提交
# Copyright (c) 2021 Huawei Device Co., Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

import("//build/ohos.gni")

config("f2fs-defaults") {
  cflags = [
    "-Wno-pointer-sign",
    "-Wno-unused-variable",
    "-Wno-string-plus-int",
    "-Wno-error=format",
    "-Wno-unused-function",
    "-Wno-unused-parameter",
    "-Wno-incompatible-pointer-types",
  ]
  if (current_toolchain == host_toolchain) {
    cflags += ["-DCONF_TARGET_HOST"]
  }
  ldflags = [ "-lpthread" ]
}

###################################################
##Build fsck
ohos_executable("fsck.f2fs") {
  branch_protector_ret = "pac_ret"
  configs = [ ":f2fs-defaults" ]
  sources = [
    "../lib/extra_fsck.c",
    "../tools/debug_tools/fsck_debug.c",
    "../tools/f2fs_tools/f2fs_tools.c",
    "compress.c",
    "dedup.c",
    "defrag.c",
    "dict.c",
    "dir.c",
    "dump.c",
    "fsck.c",
    "fsck_time.c",
    "main.c",
    "mkquota.c",
    "mount.c",
    "node.c",
    "quotaio.c",
    "quotaio_tree.c",
    "quotaio_v2.c",
    "resize.c",
    "segment.c",
    "sload.c",
    "xattr.c",
    "queue.c"
  ]

  include_dirs = [
    ".",
    "../tools/debug_tools",
    "../tools/f2fs_tools",
    "//third_party/f2fs-tools",
    "//third_party/f2fs-tools/include",
    "//third_party/f2fs-tools/lib",
  ]

  deps = [ "//third_party/f2fs-tools/lib:libf2fs" ]

  external_deps = [
    "bounds_checking_function:libsec_shared",
    "e2fsprogs:libdacconfig",
  ]

  defines = [ "HAVE_CONFIG_H" ]

  symlink_target_name = [
    "resize.f2fs",
    "sload.f2fs",
    "f2fslabel",
  ]

  install_enable = true
  subsystem_name = "thirdparty"
  part_name = "f2fs-tools"
  install_images = [
    "system",
    "updater",
  ]
}