load("//:build_variables.bzl", "COPTS")
load("//cuttlefish/bazel:rules.bzl", "cf_cc_binary", "cf_cc_library")

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

cf_cc_library(
    name = "libcvd",
    srcs = ["cvd.cpp"],
    hdrs = ["cvd.h"],
    copts = COPTS + ["-Werror=sign-compare"],
    deps = [
        "//cuttlefish/common/libs/utils:environment",
        "//cuttlefish/host/commands/cvd/cli:command_request",
        "//cuttlefish/host/commands/cvd/cli:frontline_parser",
        "//cuttlefish/host/commands/cvd/cli:nesting_commands",
        "//cuttlefish/host/commands/cvd/cli/selector:selector_common_parser",
        "//cuttlefish/host/commands/cvd/instances",
        "//cuttlefish/host/commands/cvd/instances:instance_manager",
        "//cuttlefish/host/commands/cvd/instances/lock",
        "//cuttlefish/host/commands/cvd/utils",
        "//cuttlefish/host/libs/vm_manager",
        "//cuttlefish/result",
    ],
)

cf_cc_binary(
    name = "cvd",
    srcs = ["main.cc"],
    clang_format_enabled = False,
    deps = [
        ":libcvd",
        "//cuttlefish/common/libs/utils:environment",
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/common/libs/utils:subprocess",
        "//cuttlefish/common/libs/utils:tee_logging",
        "//cuttlefish/flag_parser",
        "//cuttlefish/host/commands/cvd/cli:log_files",
        "//cuttlefish/host/commands/cvd/utils",
        "//cuttlefish/host/commands/cvd/version",
        "//cuttlefish/host/libs/vm_manager",
        "//cuttlefish/posix:strerror",
        "//libbase",
        "@abseil-cpp//absl/cleanup",
        "@abseil-cpp//absl/log",
        "@abseil-cpp//absl/strings",
        "@android_system_core//:libsparse",
        "@fmt",
        "@protobuf",
    ],
)
