blob: 03c42b21f3fb02a0a16c79260d480cc60a71d9f5 [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",
Janis Danisevskis9d90b812020-11-25 21:02:11 -080021 "liblog_rust",
22 "libnix",
23 "libthiserror",
Joel Galenson46d6fd02020-11-19 17:58:33 -080024 ],
Janis Danisevskis9d90b812020-11-25 21:02:11 -080025 shared_libs: [
26 "libkeystore2_crypto",
27 "libcrypto",
28 ],
Joel Galenson46d6fd02020-11-19 17:58:33 -080029}
30
31cc_library {
32 name: "libkeystore2_crypto",
33 srcs: [
34 "crypto.cpp",
35 "certificate_utils.cpp",
36 ],
Janis Danisevskis9d90b812020-11-25 21:02:11 -080037 export_include_dirs: ["include"],
Joel Galenson46d6fd02020-11-19 17:58:33 -080038 shared_libs: [
39 "libcrypto",
40 "liblog",
41 ],
42}
43
44rust_bindgen {
45 name: "libkeystore2_crypto_bindgen",
46 wrapper_src: "crypto.hpp",
47 crate_name: "keystore2_crypto_bindgen",
48 source_stem: "bindings",
49 host_supported: true,
50}
51
52rust_test {
53 name: "keystore2_crypto_test_rust",
54 crate_name: "keystore2_crypto_test_rust",
55 srcs: ["lib.rs"],
56 test_suites: ["general-tests"],
57 auto_gen_config: true,
58 rustlibs: [
59 "libkeystore2_crypto_bindgen",
Janis Danisevskis9d90b812020-11-25 21:02:11 -080060 "liblog_rust",
61 "libnix",
62 "libthiserror",
Joel Galenson46d6fd02020-11-19 17:58:33 -080063 ],
64 static_libs: [
65 "libkeystore2_crypto",
66 ],
67 shared_libs: [
68 "libc++",
69 "libcrypto",
Janis Danisevskis9d90b812020-11-25 21:02:11 -080070 "liblog",
Joel Galenson46d6fd02020-11-19 17:58:33 -080071 ],
72}
73
74cc_test {
Janis Danisevskis9d90b812020-11-25 21:02:11 -080075 name: "keystore2_crypto_test",
Joel Galenson46d6fd02020-11-19 17:58:33 -080076 cflags: [
77 "-Wall",
78 "-Werror",
79 "-Wextra",
80 ],
81 srcs: [
82 "tests/certificate_utils_test.cpp",
83 "tests/gtest_main.cpp",
84 ],
Janis Danisevskis9d90b812020-11-25 21:02:11 -080085 test_suites: ["general-tests"],
Joel Galenson46d6fd02020-11-19 17:58:33 -080086 static_libs: [
87 "libkeystore2_crypto",
88 ],
89 shared_libs: [
90 "libcrypto",
91 ],
Joel Galenson46d6fd02020-11-19 17:58:33 -080092}