blob: 63853f77fa9ca5aa8a5ec2bfc8f29edb20030ce0 [file] [log] [blame]
Prabir Pradhan0762b1f2023-06-22 23:08:18 +00001// Copyright 2023 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15rust_defaults {
16 name: "libinput_rust_defaults",
17 crate_name: "input",
18 srcs: ["lib.rs"],
19 host_supported: true,
20 rustlibs: [
21 "libbitflags",
22 "libcxx",
23 "libinput_bindgen",
24 "liblogger",
25 "liblog_rust",
26 "inputconstants-rust",
Vaibhav Devmurari099fb592024-06-26 14:26:30 +000027 "libserde",
28 "libserde_json",
Prabir Pradhan0762b1f2023-06-22 23:08:18 +000029 ],
30 whole_static_libs: [
31 "libinput_from_rust_to_cpp",
32 ],
33 shared_libs: [
34 "libbase",
35 ],
36}
37
38rust_library {
39 name: "libinput_rust",
40 defaults: ["libinput_rust_defaults"],
41}
42
43rust_ffi_static {
44 name: "libinput_rust_ffi",
45 defaults: ["libinput_rust_defaults"],
46}
47
48rust_test {
49 name: "libinput_rust_test",
50 defaults: ["libinput_rust_defaults"],
51 test_options: {
52 unit_test: true,
53 },
54 test_suites: ["device_tests"],
55 sanitize: {
56 hwaddress: true,
57 },
58}
59
60genrule {
61 name: "libinput_cxx_bridge_code",
62 tools: ["cxxbridge"],
63 cmd: "$(location cxxbridge) $(in) >> $(out)",
64 srcs: ["lib.rs"],
65 out: ["input_cxx_bridge_generated.cpp"],
66}
67
68genrule {
69 name: "libinput_cxx_bridge_header",
70 tools: ["cxxbridge"],
71 cmd: "$(location cxxbridge) $(in) --header >> $(out)",
72 srcs: ["lib.rs"],
73 out: ["input_cxx_bridge.rs.h"],
74}