blob: 81a1c29618904267e4db42975337e496c3ade001 [file] [log] [blame]
package {
default_team: "trendy_team_fwk_nfc",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "system_nfc_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["system_nfc_license"],
}
rust_defaults {
name: "nfc_rust_defaults",
target: {
darwin: {
enabled: false,
},
},
host_supported: true,
}
cc_defaults {
name: "nfc_ffi_defaults",
target: {
darwin: {
enabled: false,
},
},
}
rust_library {
name: "libnfc_rnci",
defaults: ["nfc_rust_defaults"],
crate_name: "nfc_rnci",
srcs: ["nci/nci.rs"],
host_supported: true,
rustlibs: [
"libnfc_packets",
"libbytes",
"libnfc_hal",
"libpdl_runtime",
"libtokio",
"libcxx",
"liblog_rust",
],
proc_macros: ["libnum_derive"],
}
rust_library {
name: "libnfc_hal",
defaults: ["nfc_rust_defaults"],
crate_name: "nfc_hal",
srcs: ["hal/hal.rs"],
host_supported: true,
rustlibs: [
"libnfc_packets",
"libbytes",
"libpdl_runtime",
"libthiserror",
"libtokio",
"libcxx",
"liblog_rust",
],
proc_macros: ["libnum_derive"],
target: {
android: {
whole_static_libs: ["libnfc_hidl_hal_cxx"],
shared_libs: [
"[email protected]",
"[email protected]",
"[email protected]",
"libhidlbase",
"libutils",
],
},
},
}
genrule {
name: "libnfc_hidl_hal_bridge_header",
tools: ["cxxbridge"],
cmd: "$(location cxxbridge) $(in) --header > $(out)",
srcs: ["hal/hidl_hal.rs"],
out: ["hal/hidl_hal.rs.h"],
}
genrule {
name: "libnfc_hidl_hal_bridge_code",
tools: ["cxxbridge"],
cmd: "$(location cxxbridge) $(in) >> $(out)",
srcs: ["hal/hidl_hal.rs"],
out: ["hidl_hal_generated.cc"],
}
cc_library_static {
name: "libnfc_hidl_hal_cxx",
defaults: [
"rust_static_cc_lib_defaults",
"nfc_ffi_defaults",
],
srcs: ["hal/ffi/hidl.cc"],
local_include_dirs: ["hal/ffi"],
generated_headers: [
"libnfc_hidl_hal_bridge_header",
"cxx-bridge-header",
],
generated_sources: ["libnfc_hidl_hal_bridge_code"],
shared_libs: [
"[email protected]",
"[email protected]",
"[email protected]",
"libhidlbase",
"libutils",
],
}