| # Copyright 2023 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. |
| |
| import("//build/components.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//src/starnix/build/args.gni") |
| |
| rustc_library("starnix_uapi") { |
| name = "starnix_uapi" |
| edition = "2024" |
| version = "0.1.0" |
| with_unit_tests = true |
| |
| sources = [ |
| "src/${current_cpu}.rs", |
| "src/arc_key.rs", |
| "src/as_any.rs", |
| "src/auth.rs", |
| "src/device_id.rs", |
| "src/elf.rs", |
| "src/errors.rs", |
| "src/file_lease.rs", |
| "src/file_mode.rs", |
| "src/inotify_mask.rs", |
| "src/iptables_flags.rs", |
| "src/kcmp.rs", |
| "src/lib.rs", |
| "src/math.rs", |
| "src/mount_flags.rs", |
| "src/open_flags.rs", |
| "src/personality.rs", |
| "src/range_ext.rs", |
| "src/resource_limits.rs", |
| "src/restricted_aspace.rs", |
| "src/seal_flags.rs", |
| "src/selinux.rs", |
| "src/signals.rs", |
| "src/syslog.rs", |
| "src/uapi.rs", |
| "src/union.rs", |
| "src/unmount_flags.rs", |
| "src/user_address.rs", |
| "src/user_value.rs", |
| "src/version.rs", |
| "src/vfs.rs", |
| ] |
| |
| if (current_cpu == "arm64") { |
| sources += [ "src/arm.rs" ] |
| } |
| |
| deps = [ |
| "//sdk/rust/zx-status", |
| "//sdk/rust/zx-types", |
| "//src/lib/diagnostics/inspect/contrib/stubs:inspect_stubs", |
| "//src/starnix/lib/atomic_bitflags", |
| "//src/starnix/lib/linux_uapi", |
| "//src/starnix/lib/range_map", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:bstr", |
| "//third_party/rust_crates:ref-cast", |
| "//third_party/rust_crates:static_assertions", |
| "//third_party/rust_crates:zerocopy", |
| ] |
| |
| test_deps = [ "//src/lib/fuchsia" ] |
| |
| configs += [ "//src/starnix/build:kernel_library_config" ] |
| } |
| |
| fuchsia_unittest_package("starnix_uapi-tests") { |
| deps = [ ":starnix_uapi_test" ] |
| |
| test_specs = { |
| log_settings = { |
| # Tests exercise failure cases, so ERROR logs are expected. |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":starnix_uapi-tests" ] |
| } |