| # Copyright 2026 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| load("@fuchsia_build_info//:args.bzl", "local_bench") |
| load("//build/bazel/rules/rust:defs.bzl", "rustc_binary", "rustc_library") |
| |
| package(default_applicable_licenses = ["//:license"]) |
| |
| rustc_library( |
| name = "fuchsia-criterion", |
| srcs = ["src/lib.rs"], |
| crate_features = ["local_bench"] if local_bench else [], |
| edition = "2024", |
| visibility = ["//visibility:public"], |
| with_unit_tests = True, |
| deps = [ |
| "//third_party/rust_crates/vendor:criterion", |
| "//third_party/rust_crates/vendor:csv", |
| "//third_party/rust_crates/vendor:tempfile", |
| "//third_party/rust_crates/vendor:walkdir", |
| ], |
| ) |
| |
| rustc_binary( |
| name = "criterion_bench_bin", |
| srcs = ["examples/main.rs"], |
| crate_name = "criterion_bench", |
| crate_root = "examples/main.rs", |
| edition = "2024", |
| deps = [":fuchsia-criterion"], |
| ) |