• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "system_bt_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["system_bt_license"],
8}
9
10rust_library {
11    name: "libbt_common",
12    defaults: ["gd_rust_defaults"],
13    crate_name: "bt_common",
14    srcs: ["src/lib.rs"],
15    edition: "2018",
16    rustlibs: [
17        "libtokio",
18        "libnix",
19        "liblazy_static",
20        "liblog_rust",
21        "libcxx",
22        "libgrpcio",
23    ],
24    target: {
25        android: {
26            rustlibs: [
27                "libandroid_logger",
28            ],
29            whole_static_libs: ["libbt_common_sys_prop_cxx"],
30            shared_libs: [
31                "libcutils",
32            ],
33        },
34        host: {
35            rustlibs: [
36                "libenv_logger",
37            ],
38        },
39    },
40    proc_macros: [
41        "libpaste",
42    ],
43}
44
45rust_test_host {
46    name: "libbt_common_inline_tests",
47    srcs: ["src/lib.rs"],
48    test_suites: ["general-tests"],
49    auto_gen_config: true,
50    rustlibs: [
51        "libtokio",
52        "libnix",
53        "liblazy_static",
54        "liblog_rust",
55        "libenv_logger",
56        "libcxx",
57        "libgrpcio",
58    ],
59    proc_macros: [
60        "libpaste",
61    ],
62}
63
64genrule {
65    name: "libbt_common_sys_prop_bridge_code",
66    tools: ["cxxbridge"],
67    cmd: "$(location cxxbridge) $(in) >> $(out)",
68    srcs: ["src/sys_prop.rs"],
69    out: ["sys_prop_generated.cc"],
70}
71
72cc_library_static {
73    name: "libbt_common_sys_prop_cxx",
74    defaults: ["gd_ffi_defaults"],
75    local_include_dirs: ["src/ffi"],
76    srcs: ["src/ffi/sys_prop.cc"],
77    generated_headers: ["cxx-bridge-header"],
78    generated_sources: ["libbt_common_sys_prop_bridge_code"],
79    shared_libs: [
80        "libcutils",
81    ],
82}
83