Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 1 | // 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 | |
| 15 | rust_library { |
| 16 | name: "libkeystore2_crypto_rust", |
| 17 | crate_name: "keystore2_crypto", |
| 18 | srcs: ["lib.rs"], |
| 19 | rustlibs: [ |
| 20 | "libkeystore2_crypto_bindgen", |
Janis Danisevskis | 9d90b81 | 2020-11-25 21:02:11 -0800 | [diff] [blame^] | 21 | "liblog_rust", |
| 22 | "libnix", |
| 23 | "libthiserror", |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 24 | ], |
Janis Danisevskis | 9d90b81 | 2020-11-25 21:02:11 -0800 | [diff] [blame^] | 25 | shared_libs: [ |
| 26 | "libkeystore2_crypto", |
| 27 | "libcrypto", |
| 28 | ], |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | cc_library { |
| 32 | name: "libkeystore2_crypto", |
| 33 | srcs: [ |
| 34 | "crypto.cpp", |
| 35 | "certificate_utils.cpp", |
| 36 | ], |
Janis Danisevskis | 9d90b81 | 2020-11-25 21:02:11 -0800 | [diff] [blame^] | 37 | export_include_dirs: ["include"], |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 38 | shared_libs: [ |
| 39 | "libcrypto", |
| 40 | "liblog", |
| 41 | ], |
| 42 | } |
| 43 | |
| 44 | rust_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 | |
| 52 | rust_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 Danisevskis | 9d90b81 | 2020-11-25 21:02:11 -0800 | [diff] [blame^] | 60 | "liblog_rust", |
| 61 | "libnix", |
| 62 | "libthiserror", |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 63 | ], |
| 64 | static_libs: [ |
| 65 | "libkeystore2_crypto", |
| 66 | ], |
| 67 | shared_libs: [ |
| 68 | "libc++", |
| 69 | "libcrypto", |
Janis Danisevskis | 9d90b81 | 2020-11-25 21:02:11 -0800 | [diff] [blame^] | 70 | "liblog", |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 71 | ], |
| 72 | } |
| 73 | |
| 74 | cc_test { |
Janis Danisevskis | 9d90b81 | 2020-11-25 21:02:11 -0800 | [diff] [blame^] | 75 | name: "keystore2_crypto_test", |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 76 | cflags: [ |
| 77 | "-Wall", |
| 78 | "-Werror", |
| 79 | "-Wextra", |
| 80 | ], |
| 81 | srcs: [ |
| 82 | "tests/certificate_utils_test.cpp", |
| 83 | "tests/gtest_main.cpp", |
| 84 | ], |
Janis Danisevskis | 9d90b81 | 2020-11-25 21:02:11 -0800 | [diff] [blame^] | 85 | test_suites: ["general-tests"], |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 86 | static_libs: [ |
| 87 | "libkeystore2_crypto", |
| 88 | ], |
| 89 | shared_libs: [ |
| 90 | "libcrypto", |
| 91 | ], |
Joel Galenson | 46d6fd0 | 2020-11-19 17:58:33 -0800 | [diff] [blame] | 92 | } |