load("@prelude//platforms:defs.bzl", "host_configuration")
load("//build:bench.bzl", "rust_benchmark")

rust_library(
    name = "fastrand",
    srcs = glob(["src/**/*.rs"]),
    visibility = ["PUBLIC"],
    tests = [":fastrand_unittests", ":fastrand_benchmarks"],
)

rust_test(
    name = "fastrand_unittests",
    srcs = glob(["src/**/*.rs"]),
    target_compatible_with = [host_configuration.os, host_configuration.cpu],
    visibility = ["PUBLIC"],
)

rust_benchmark(
    name = "fastrand_benchmarks",
    srcs = ["./benches/bench.rs"],
    crate_root = "./benches/bench.rs",
    deps = [
        ":fastrand",
        "//third-party:criterion",
    ],
    visibility = ["PUBLIC"],
)
