1# Copyright (C) 2024 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 15load("@rules_rust//rust:defs.bzl", "rust_library", "rust_static_library", "rust_test") 16 17package( 18 default_visibility = ["//visibility:public"], 19) 20 21rust_library( 22 name = "libabr", 23 srcs = ["src/lib.rs"], 24 crate_name = "abr", 25 edition = "2021", 26) 27 28rust_test( 29 name = "libabr_test", 30 crate = ":libabr", 31) 32 33rust_static_library( 34 name = "libabr_c", 35 srcs = [ 36 "src/c_staticlib.rs", 37 "src/utils.rs", 38 ], 39 crate_name = "abr_c", 40 crate_root = "src/c_staticlib.rs", 41 edition = "2021", 42 deps = [":libabr"], 43) 44 45rust_test( 46 name = "libabr_c_test", 47 crate = ":libabr_c", 48) 49 50test_suite( 51 name = "libabr_tests", 52 tests = [ 53 ":libabr_c_test", 54 ":libabr_test", 55 ], 56) 57