blob: 352f2be001d224c8cd4a5531d075204009fbf4e4 [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
Bob Badour5f8427a2021-02-26 02:58:11 -080015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "system_security_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["system_security_license"],
22}
23
Joel Galensonc19f0062021-02-22 09:52:18 -080024rust_library {
25 name: "libkeystore2_vintf_rust",
26 crate_name: "keystore2_vintf",
27 srcs: ["lib.rs"],
28 rustlibs: [
29 "libkeystore2_vintf_bindgen",
30 ],
31 shared_libs: [
32 "libkeystore2_vintf_cpp",
33 "libvintf",
34 ],
35}
36
37cc_library {
38 name: "libkeystore2_vintf_cpp",
39 srcs: [
40 "vintf.cpp",
41 ],
42 shared_libs: [
43 "libvintf",
44 ],
45}
46
47rust_bindgen {
48 name: "libkeystore2_vintf_bindgen",
49 wrapper_src: "vintf.hpp",
50 crate_name: "keystore2_vintf_bindgen",
51 source_stem: "bindings",
52 host_supported: true,
53 shared_libs: ["libvintf"],
54 bindgen_flags: [
55 "--size_t-is-usize",
Joel Galenson915d3ea2021-04-19 09:02:41 -070056 "--allowlist-function", "getHalNames",
57 "--allowlist-function", "getHalNamesAndVersions",
58 "--allowlist-function", "getHidlInstances",
59 "--allowlist-function", "getAidlInstances",
60 "--allowlist-function", "freeNames",
Joel Galensonc19f0062021-02-22 09:52:18 -080061 ],
62}
63
64rust_test {
65 name: "keystore2_vintf_test",
66 crate_name: "keystore2_vintf_test",
67 srcs: ["lib.rs"],
68 test_suites: ["general-tests"],
69 auto_gen_config: true,
70 rustlibs: [
71 "libkeystore2_vintf_bindgen",
72 ],
73 static_libs: [
74 "libkeystore2_vintf_cpp",
75 ],
76 shared_libs: [
77 "libc++",
78 "libvintf",
79 ],
80}
Joel Galenson733d1d02021-08-23 13:47:37 -070081
82rust_test {
83 name: "libkeystore2_vintf_bindgen_test",
84 srcs: [":libkeystore2_vintf_bindgen"],
85 crate_name: "keystore2_vintf_bindgen_test",
86 test_suites: ["general-tests"],
87 auto_gen_config: true,
88 clippy_lints: "none",
89 lints: "none",
90}