blob: da7935ab2f4bf866bf88192b3f7c8b93cbd16134 [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",
Janis Danisevskisef14e1a2021-02-23 23:16:55 -080049 "--whitelist-function", "getAidlInstances",
Joel Galensonc19f0062021-02-22 09:52:18 -080050 "--whitelist-function", "freeNames",
51 ],
52}
53
54rust_test {
55 name: "keystore2_vintf_test",
56 crate_name: "keystore2_vintf_test",
57 srcs: ["lib.rs"],
58 test_suites: ["general-tests"],
59 auto_gen_config: true,
60 rustlibs: [
61 "libkeystore2_vintf_bindgen",
62 ],
63 static_libs: [
64 "libkeystore2_vintf_cpp",
65 ],
66 shared_libs: [
67 "libc++",
68 "libvintf",
69 ],
70}