xref: /aosp_15_r20/frameworks/minikin/rust/Android.bp (revision 834a2baab5fdfc28e9a428ee87c7ea8f6a06a53d)
1// Copyright 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
15rust_defaults {
16    name: "libminikin_rust_defaults",
17    crate_name: "minikin",
18    srcs: ["minikin.rs"],
19    host_supported: true,
20    rustlibs: [
21        "libcxx",
22        "liblogger",
23        "liblog_rust",
24        "libflags_rust",
25    ],
26    whole_static_libs: [
27        "libminikin_from_rust_to_cpp",
28    ],
29    static_libs: [
30        "libflags_rust_cpp_bridge",
31    ],
32    shared_libs: [
33        "libbase",
34    ],
35    target: {
36        android: {
37            rustlibs: [
38                "libandroid_text_flags_rust",
39            ],
40        },
41    },
42}
43
44rust_ffi_static {
45    name: "libminikin_rust_ffi",
46    defaults: ["libminikin_rust_defaults"],
47}
48
49genrule {
50    name: "libminikin_cxx_bridge_code",
51    tools: ["cxxbridge"],
52    cmd: "$(location cxxbridge) $(in) >> $(out)",
53    srcs: ["minikin.rs"],
54    out: ["minikin_cxx_bridge_generated.cpp"],
55}
56
57genrule {
58    name: "libminikin_cxx_bridge_header",
59    tools: ["cxxbridge"],
60    cmd: "$(location cxxbridge) $(in) --header >> $(out)",
61    srcs: ["minikin.rs"],
62    out: ["minikin_cxx_bridge.rs.h"],
63}
64