1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_library_headers {
22    name: "libberberis_native_bridge_headers",
23    defaults: ["berberis_defaults"],
24    host_supported: true,
25    export_include_dirs: ["include"],
26}
27
28// filegroups ensure valid file paths for modules depending on
29// libberberis_native_bridge_defaults.
30filegroup {
31    name: "_libberberis_native_bridge_srcs",
32    srcs: [
33        "native_bridge.cc",
34    ],
35}
36
37// Shared source files for compiling guest-specific static libs.
38// See libberberis_native_bridge_riscv64 below.
39cc_defaults {
40    name: "libberberis_native_bridge_defaults",
41    host_supported: true,
42    header_libs: [
43        "jni_headers",
44        "libberberis_base_headers",
45        "libberberis_guest_abi_headers",
46        "libberberis_guest_loader_headers",
47        "libberberis_guest_os_primitives_headers",
48        "libberberis_guest_state_headers",
49        "libberberis_native_bridge_headers",
50        "libberberis_runtime_headers",
51    ],
52    target: {
53        android: {
54            srcs: [":_libberberis_native_bridge_srcs"],
55            header_libs: [
56                "libberberis_jni_headers",
57                "libberberis_native_activity_headers",
58            ],
59            static_libs: [
60                "libprocinfo",
61            ],
62        },
63    },
64}
65
66cc_library_static {
67    name: "libberberis_native_bridge_riscv64",
68    defaults: [
69        "berberis_defaults_64",
70        "libberberis_native_bridge_defaults",
71    ],
72    header_libs: [
73        "libberberis_guest_abi_riscv64_headers",
74    ],
75    target: {
76        android: {
77            srcs: ["riscv64/native_bridge.cc"],
78        },
79    },
80}
81