| # Copyright 2023 The Fuchsia Authors |
| # |
| # Use of this source code is governed by a MIT-style |
| # license that can be found in the LICENSE file or at |
| # https://opensource.org/licenses/MIT |
| |
| import("//build/components.gni") |
| import("//build/cpp/library_headers.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| group("id_allocator") { |
| public_deps = [ ":headers" ] |
| } |
| |
| library_headers("headers") { |
| headers = [ "lib/id_allocator.h" ] |
| public_deps = [ |
| "//zircon/system/ulib/bitmap", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| source_set("kernel-tests") { |
| testonly = true |
| sources = [ "id_allocator_tests.cc" ] |
| deps = [ |
| ":headers", |
| "//zircon/kernel/lib/unittest", |
| ] |
| } |
| |
| rustc_library("id-allocator-rs") { |
| edition = "2024" |
| name = "id_allocator" |
| sources = [ "src/lib.rs" ] |
| deps = [ |
| "//sdk/rust/zx-status", |
| "//src/lib/ksync", |
| "//third_party/rust_crates:pin-init", |
| "//zircon/system/ulib/bitmap/rust:bitmap", |
| ] |
| if (!is_kernel) { |
| with_unit_tests = true |
| } |
| } |
| |
| fuchsia_unittest_package("id-allocator-rust-test-pkg") { |
| package_name = "id-allocator-rust-test" |
| deps = [ ":id-allocator-rs_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":id-allocator-rust-test-pkg" ] |
| } |
| |
| group("phys-tests") { |
| testonly = true |
| } |
| |
| group("boot_tests") { |
| testonly = true |
| } |