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

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

cc_binary(
    name = "fec",
    srcs = [
        "libcrypto_utils/include/crypto_utils/android_pubkey.h",
        "libfec/avb_utils.cpp",
        "libfec/avb_utils.h",
        "libfec/fec_open.cpp",
        "libfec/fec_private.h",
        "libfec/fec_process.cpp",
        "libfec/fec_read.cpp",
        "libfec/fec_verity.cpp",
        "libfec/include/fec/ecc.h",
        "libfec/include/fec/io.h",
        "libutils/include/utils/Compat.h",
        "squashfs_utils/squashfs_utils.h",
        "verity/fec/image.cpp",
        "verity/fec/image.h",
        "verity/fec/main.cpp",
    ],
    copts = [
        "-DFEC_NO_KLOG",
        "-DNDEBUG",
        "-Wno-private-header",
        "-Wno-vla-cxx-extension",
    ],
    includes = [
        "libcrypto_utils/include",
        "libfec/include",
        "libutils/include",
        "squashfs_utils",
    ],
    deps = [
        "//libbase",
        "//libext4_utils",
        "@android_system_core//:libsparse",
        "@avb//:libavb",
        "@boringssl//:crypto",
        "@fec_rs//:libfec_rs",
    ],
)
