aboutsummaryrefslogtreecommitdiff
path: root/tools/rootcanal/lmp/Android.bp
blob: e438e6a54cbb2df711bb7f89722ff5347c5a27f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "system_bt_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["system_bt_license"],
}

rust_ffi {
    name: "liblmp",
    host_supported: true,
    vendor_available : true,
    crate_name: "lmp",
    srcs: [
        "src/lib.rs",
        ":LmpGeneratedPackets_rust",
    ],
    edition: "2018",
    proc_macros: ["libnum_derive"],
    rustlibs: [
        "libbt_packets_nonapex",
        "libbytes",
        "libnum_bigint",
        "libnum_integer",
        "libnum_traits",
        "libthiserror",
        "libpin_utils",
        "librand",
    ],
    include_dirs: ["include"],
}

genrule {
    name: "LmpGeneratedPackets_rust",
    tools: [
        "bluetooth_packetgen",
    ],
    cmd: "$(location bluetooth_packetgen) --include=packages/modules/Bluetooth/tools/rootcanal/lmp  --out=$(genDir) $(in) --rust",
    srcs: [
        "lmp_packets.pdl",
    ],
    out: [
        "lmp_packets.rs",
    ],
}

rust_test_host {
    name: "liblmp_tests",
    crate_name: "lmp",
    srcs: [
        "src/lib.rs",
        ":LmpGeneratedPackets_rust",
    ],
    auto_gen_config: true,
    edition: "2018",
    proc_macros: ["libnum_derive", "libpaste"],
    rustlibs: [
        "libbt_packets",
        "libbytes",
        "libnum_bigint",
        "libnum_integer",
        "libnum_traits",
        "libthiserror",
        "libpin_utils",
        "librand",
    ],
}