load("@rules_cc//cc:cc_library.bzl", "cc_library")

load("//:build_variables.bzl", "COPTS")

package(
    default_visibility = [
        "//:android_cuttlefish",
        "@android_system_core//:__subpackages__",
    ],
)

cc_library(
    name = "libext4_utils",
    srcs = [
        "ext4_sb.cpp",
        "ext4_utils.cpp",
        "helpers.h",
    ],
    hdrs = [
        "include/ext4_utils/ext4.h",
        "include/ext4_utils/ext4_extents.h",
        "include/ext4_utils/ext4_kernel_headers.h",
        "include/ext4_utils/ext4_sb.h",
        "include/ext4_utils/ext4_utils.h",
        "include/ext4_utils/jbd2.h",
        "include/ext4_utils/xattr.h",
    ],
    copts = COPTS + [
        "-Wno-module-import-in-extern-c",
    ],
    strip_include_prefix = "include",
    features = ["-parse_headers"],
)

exports_files([
    "mke2fs.conf",
    "mkuserimg_mke2fs.py",
])
