blob: 31a1de9b16bd1c39b794ebf57257a90949f7eb73 [file] [log] [blame]
Joel Galensonc19f0062021-02-22 09:52:18 -08001// Copyright 2021, 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_library {
16 name: "libkeystore2_vintf_rust",
17 crate_name: "keystore2_vintf",
18 srcs: ["lib.rs"],
19 rustlibs: [
20 "libkeystore2_vintf_bindgen",
21 ],
22 shared_libs: [
23 "libkeystore2_vintf_cpp",
24 "libvintf",
25 ],
26}
27
28cc_library {
29 name: "libkeystore2_vintf_cpp",
30 srcs: [
31 "vintf.cpp",
32 ],
33 shared_libs: [
34 "libvintf",
35 ],
36}
37
38rust_bindgen {
39 name: "libkeystore2_vintf_bindgen",
40 wrapper_src: "vintf.hpp",
41 crate_name: "keystore2_vintf_bindgen",
42 source_stem: "bindings",
43 host_supported: true,
44 shared_libs: ["libvintf"],
45 bindgen_flags: [
46 "--size_t-is-usize",
47 "--whitelist-function", "getHalNames",
48 "--whitelist-function", "getHalNamesAndVersions",
49 "--whitelist-function", "freeNames",
50 ],
51}
52
53rust_test {
54 name: "keystore2_vintf_test",
55 crate_name: "keystore2_vintf_test",
56 srcs: ["lib.rs"],
57 test_suites: ["general-tests"],
58 auto_gen_config: true,
59 rustlibs: [
60 "libkeystore2_vintf_bindgen",
61 ],
62 static_libs: [
63 "libkeystore2_vintf_cpp",
64 ],
65 shared_libs: [
66 "libc++",
67 "libvintf",
68 ],
69}