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

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

ALLOW_C = ["-Wno-module-import-in-extern-c"]

cf_cc_library(
    name = "adb_connector",
    srcs = ["adb_connector.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "assemble_cvd",
    srcs = ["assemble_cvd.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "avbtool",
    srcs = ["avbtool.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@abseil-cpp//absl/log:check",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "baseline",
    srcs = ["baseline.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:map_exec",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "casimir",
    srcs = ["casimir.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "casimir_control_server",
    srcs = ["casimir_control_server.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "cf_vhost_user_input",
    srcs = ["cf_vhost_user_input.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "control_env_proxy_server",
    srcs = ["control_env_proxy_server.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "cvd_internal_start",
    srcs = ["cvd_internal_start.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "echo_server",
    srcs = ["echo_server.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "gnss_grpc_proxy",
    srcs = ["gnss_grpc_proxy.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "kernel_log_monitor",
    srcs = ["kernel_log_monitor.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "log_tee",
    srcs = ["log_tee.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "logcat_receiver",
    srcs = ["logcat_receiver.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "metrics",
    srcs = ["metrics.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "mkenvimage_slim",
    srcs = ["mkenvimage_slim.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "modem_simulator",
    srcs = ["modem_simulator.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "netsimd",
    srcs = ["netsimd.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "newfs_msdos",
    srcs = ["newfs_msdos.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "no_policy",
    srcs = ["no_policy.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "openwrt_control_server",
    srcs = ["openwrt_control_server.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "operator_proxy",
    srcs = ["operator_proxy.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "process_restarter",
    srcs = ["process_restarter.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "run_cvd",
    srcs = ["run_cvd.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@abseil-cpp//absl/strings",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "screen_recording_server",
    srcs = ["screen_recording_server.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "secure_env",
    srcs = ["secure_env.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "simg2img",
    srcs = ["simg2img.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "socket_vsock_proxy",
    srcs = ["socket_vsock_proxy.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "tcp_connector",
    srcs = ["tcp_connector.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "tombstone_receiver",
    srcs = ["tombstone_receiver.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "vhost_device_vsock",
    srcs = ["vhost_device_vsock.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "webrtc",
    srcs = ["webrtc.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "webrtc_operator",
    srcs = ["webrtc_operator.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "wmediumd",
    srcs = ["wmediumd.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)

cf_cc_library(
    name = "wmediumd_gen_config",
    srcs = ["wmediumd_gen_config.cpp"],
    copts = COPTS + ALLOW_C,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
    alwayslink = True,
)
