blob: 061cf9acb25b3a491d2a3f8e16bd67ef6b923a6c [file] [log] [blame]
Joel Galenson46d6fd02020-11-19 17:58:33 -08001// Copyright 2020, 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_crypto_rust",
17 crate_name: "keystore2_crypto",
18 srcs: ["lib.rs"],
19 rustlibs: [
20 "libkeystore2_crypto_bindgen",
21 ],
22 static_libs: ["libkeystore2_crypto"],
23 shared_libs: ["libcrypto"],
24}
25
26cc_library {
27 name: "libkeystore2_crypto",
28 srcs: [
29 "crypto.cpp",
30 "certificate_utils.cpp",
31 ],
32 export_include_dirs: ["include",],
33 shared_libs: [
34 "libcrypto",
35 "liblog",
36 ],
37}
38
39rust_bindgen {
40 name: "libkeystore2_crypto_bindgen",
41 wrapper_src: "crypto.hpp",
42 crate_name: "keystore2_crypto_bindgen",
43 source_stem: "bindings",
44 host_supported: true,
45}
46
47rust_test {
48 name: "keystore2_crypto_test_rust",
49 crate_name: "keystore2_crypto_test_rust",
50 srcs: ["lib.rs"],
51 test_suites: ["general-tests"],
52 auto_gen_config: true,
53 rustlibs: [
54 "libkeystore2_crypto_bindgen",
55 "libkeystore2_crypto_rust",
56 ],
57 static_libs: [
58 "libkeystore2_crypto",
59 ],
60 shared_libs: [
61 "libc++",
62 "libcrypto",
63 "liblog",
64 ],
65}
66
67cc_test {
68 cflags: [
69 "-Wall",
70 "-Werror",
71 "-Wextra",
72 ],
73 srcs: [
74 "tests/certificate_utils_test.cpp",
75 "tests/gtest_main.cpp",
76 ],
77 static_libs: [
78 "libkeystore2_crypto",
79 ],
80 shared_libs: [
81 "libcrypto",
82 ],
83 name: "keystore2_crypto_test",
84}