load("@rules_cc//cc:defs.bzl", "cc_library")
load("//tools:copts.bzl", "COPTS")

cc_library(
    name = "base64",
    srcs = ["base64.cpp"],
    hdrs = ["base64.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "byte_hasher",
    hdrs = ["ByteHasher.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "byte_vector",
    hdrs = ["byte_vector.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "filesystem_utils",
    srcs = ["FilesystemUtils.cpp"],
    hdrs = ["FilesystemUtils.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
    deps = [
        ":byte_vector",
        "@bazel_tools//tools/cpp/runfiles",
    ],
)

cc_library(
    name = "iterable_bitset",
    hdrs = ["IterableBitset.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "map_utils",
    srcs = ["MapUtils.cpp"],
    hdrs = ["MapUtils.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "protobuf_warning_suppression",
    hdrs = ["ProtobufWarningSuppression.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "random_generator",
    srcs = ["RandomGenerator.cpp"],
    hdrs = ["RandomGenerator.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
    deps = [
    ],
)

cc_library(
    name = "shardok_latency_trace",
    srcs = ["ShardokLatencyTrace.cpp"],
    hdrs = ["ShardokLatencyTrace.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "repeated_proto_utils",
    srcs = [],
    hdrs = ["RepeatedProtoUtils.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
    deps = ["@com_google_protobuf//:protobuf"],
)

cc_library(
    name = "sequence_random_generator",
    hdrs = ["SequenceRandomGenerator.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0:__subpackages__",
        "//src/test/cpp/net/eagle0:__subpackages__",
    ],
    deps = [
        ":random_generator",
    ],
)

cc_library(
    name = "thread_pool",
    hdrs = ["ThreadPool.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "time_utils",
    hdrs = ["TimeUtils.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "tsv_parser",
    srcs = ["TsvParser.cpp"],
    hdrs = ["TsvParser.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
)

cc_library(
    name = "unit_conversions",
    srcs = ["UnitConversions.cpp"],
    hdrs = ["UnitConversions.hpp"],
    copts = COPTS,
    visibility = ["//visibility:public"],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library:shardok_c_types",
        "//src/main/flatbuffer/net/eagle0/shardok/storage:unit_cc_fbs",
        "//src/main/protobuf/net/eagle0/common:common_unit_cc_proto",
    ],
)
