blob: 7af7c5fe442b68a13ebbd45e978bb64cafad8377 [file] [log] [blame]
# Copyright 2024 The Fuchsia Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components/fuchsia_unittest_package.gni")
import("//build/rust/rustc_library.gni")
group("tests") {
testonly = true
deps = [ ":binder_rust_tests" ]
}
rustc_library("binder_ndk_sys") {
edition = "2021"
name = "binder_ndk_sys"
source_root = "third_party/binder_ndk_sys/lib.rs"
sources = [ source_root ]
# Remove potential warn/deny to ensure the allow below is enforced
_lint_cfg = [ "//build/config/rust:cap_lints" ]
configs += _lint_cfg
configs -= _lint_cfg
configs += [
"//build/config/rust:cap_lints_allow",
"//src/lib/android:android_rust_config",
":allow_non_snake_case",
]
deps = [ "//third_party/rust_crates:libc" ]
disable_clippy = true
}
config("allow_non_snake_case") {
rustflags = [ "-Anon_snake_case" ]
}
# This target lets us link the C++ standard library statically into programs which
# depend on the AIDL Rust library, which links in C++ code.
source_set("static_cpp_standard_library") {
all_dependent_configs =
[ "//build/config/fuchsia:static_cpp_standard_library" ]
visibility = [ ":*" ]
}
rustc_library("binder") {
edition = "2021"
sources = [
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/binder.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/binder_async.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/error.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/lib.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/native.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/parcel.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/parcel/file_descriptor.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/parcel/parcelable.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/parcel/parcelable_holder.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/proxy.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/service.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/state.rs",
"//third_party/android/platform/frameworks/native/libs/binder/rust/src/system_only.rs",
]
# Remove potential warn/deny to ensure the allow below is enforced
_lint_cfg = [ "//build/config/rust:cap_lints" ]
if (configs + _lint_cfg - _lint_cfg != configs) {
configs -= _lint_cfg
}
configs += [
"//build/config/rust:cap_lints_allow",
"//src/lib/android:android_rust_config",
]
deps = [
":binder_ndk_sys",
":static_cpp_standard_library",
"//src/lib/android/binder",
"//third_party/rust_crates:downcast-rs",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:log",
]
with_unit_tests = true
source_root = "//third_party/android/platform/frameworks/native/libs/binder/rust/src/lib.rs"
disable_clippy = true
}
fuchsia_unittest_package("binder_rust_tests") {
manifest = "meta/binder_rust_tests.cml"
deps = [ ":binder_test" ]
test_type = "system"
}