load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")
load("//cuttlefish/bazel:rules.bzl", "cf_cc_binary")

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

cf_cc_binary(
    name = "gnss_grpc_proxy",
    srcs = [
        "gnss_grpc_proxy.cpp",
    ],
    clang_format_enabled = False,
    deps = [
        ":libcvd_gnss_grpc_proxy",
        "//cuttlefish/common/libs/fs",
        "//cuttlefish/host/libs/config:cuttlefish_config",
        "//cuttlefish/host/libs/config:logging",
        "//libbase",
        "@abseil-cpp//absl/log",
        "@abseil-cpp//absl/strings",
        "@gflags",
        "@grpc",
        "@grpc//:grpc++",
        "@grpc//:grpc++_reflection",
    ],
)

proto_library(
    name = "gnss_grpc_proxy_proto",
    srcs = ["gnss_grpc_proxy.proto"],
)

cc_proto_library(
    name = "gnss_grpc_proxy_cc_proto",
    deps = [":gnss_grpc_proxy_proto"],
)

cc_grpc_library(
    name = "libcvd_gnss_grpc_proxy",
    srcs = [":gnss_grpc_proxy_proto"],
    grpc_only = True,
    deps = [
        ":gnss_grpc_proxy_cc_proto",
        "@grpc//:grpc++",
    ],
)
