blob: 1afca3001e0c0363101656445e1c472f0efc4c96 [file] [edit]
# Copyright 2025 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")
library_headers("headers") {
headers = [ "lib/spsc_buffer/spsc_buffer.h" ]
public_deps = [ "//zircon/kernel/lib/ktl" ]
}
group("spsc_buffer") {
public_deps = [ ":headers" ]
}
config("ktl_system_include") {
cflags = [
"-idirafter",
rebase_path("//zircon/kernel/lib/ktl/include", root_build_dir),
]
}
source_set("spsc_ffi_helper") {
sources = [ "tests/spsc_ffi_helper.cc" ]
include_dirs = [ "include" ]
configs += [ ":ktl_system_include" ]
deps = [
":headers",
"//zircon/system/ulib/zx",
]
}
rustc_library("spsc-buffer-rs") {
edition = "2024"
name = "spsc_buffer"
sources = [ "src/lib.rs" ]
deps = [
"//sdk/rust/zx-status",
"//src/lib/kalloc",
]
if (!is_kernel) {
test_deps = [ ":spsc_ffi_helper" ]
with_unit_tests = true
}
}
fuchsia_unittest_package("spsc-buffer-rust-test-pkg") {
package_name = "spsc-buffer-rust-test"
deps = [ ":spsc-buffer-rs_test" ]
}
group("tests") {
testonly = true
deps = [ ":spsc-buffer-rust-test-pkg" ]
}
group("kernel-tests") {
testonly = true
deps = [ "tests" ]
}
group("phys-tests") {
testonly = true
}
group("boot_tests") {
testonly = true
}