1// 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 15package { 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 24rust_library { 25 name: "libkeystore2_hal_names_rust", 26 crate_name: "keystore2_hal_names", 27 srcs: ["lib.rs"], 28 rustlibs: [ 29 "libcxx", 30 ], 31 shared_libs: [ 32 "libhidlbase", 33 ], 34 static_libs: [ 35 "libkeystore2_hal_names_cpp", 36 ], 37} 38 39cc_library_static { 40 name: "libkeystore2_hal_names_cpp", 41 srcs: ["hal_names.cpp"], 42 generated_headers: ["cxx-bridge-header"], 43 generated_sources: ["hal_names_bridge_code"], 44 shared_libs: [ 45 "libhidlbase", 46 ], 47} 48 49genrule { 50 name: "hal_names_bridge_code", 51 tools: ["cxxbridge"], 52 cmd: "$(location cxxbridge) $(in) >> $(out)", 53 srcs: ["lib.rs"], 54 out: ["hal_names_cxx_generated.cc"], 55} 56 57rust_test { 58 name: "keystore2_hal_names_test", 59 crate_name: "keystore2_hal_names_test", 60 srcs: ["lib.rs"], 61 test_suites: ["general-tests"], 62 auto_gen_config: true, 63 rustlibs: [ 64 "libcxx", 65 ], 66 static_libs: [ 67 "libkeystore2_hal_names_cpp", 68 ], 69 shared_libs: [ 70 "libc++", 71 "libhidlbase", 72 ], 73} 74