blob: 428320540a32a276aa7dae64b16d5cd5940d9157 [file] [edit]
# Copyright 2019 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/cpp/library_headers.gni")
import("//zircon/kernel/kernel_rust_crate.gni")
import("//zircon/kernel/kernel_rust_mod.gni")
library_headers("headers") {
headers = [
"lib/user_copy/internal.h",
"lib/user_copy/user_ptr.h",
"lib/user_copy/user_iovec.h",
]
public_deps = [
# <lib/user_copy/user_ptr.h> has #include <ktl/type_traits.h>.
"//zircon/kernel/lib/ktl:headers",
]
}
group("user_copy") {
public_deps = [
":headers",
":user-copy-rs",
]
}
group("tests") {
testonly = true
}
group("kernel-tests") {
testonly = true
deps = [ ":user_copy_rs_kernel_tests" ]
}
group("phys-tests") {
testonly = true
}
group("boot_tests") {
testonly = true
}
kernel_rust_mod("user-copy-rs") {
output_name = "user_copy"
source_root = "src/mod.rs"
sources = [
"src/internal.rs",
"src/mod.rs",
"src/user_iovec.rs",
"src/user_ptr.rs",
"src/user_string_view.rs",
]
deps = [
"//sdk/rust/zx-status",
"//sdk/rust/zx-types",
"//third_party/rust_crates:zerocopy",
"//zircon/system/ulib/fbl/rust:fbl",
]
}
kernel_rust_mod("user_copy_rs_kernel_tests") {
testonly = true
source_root = "tests/kernel.rs"
sources = [ "tests/kernel.rs" ]
deps = [
"//sdk/rust/zx-status",
"//sdk/rust/zx-types",
]
test_deps = [
"//src/lib/ksync",
"//zircon/kernel/lib/unittest:unittest-rs",
]
}