• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2023 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
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20cc_library_headers {
21    name: "libberberis_guest_state_headers",
22    defaults: ["berberis_defaults"],
23    host_supported: true,
24    export_include_dirs: ["include"],
25    header_libs: [
26        "libberberis_base_headers",
27        "native_bridge_guest_state_headers",
28    ],
29    export_header_lib_headers: [
30        "libberberis_base_headers",
31        "native_bridge_guest_state_headers",
32    ],
33}
34
35cc_defaults {
36    name: "berberis_guest_state_headers_defaults",
37    defaults: ["berberis_defaults"],
38    host_supported: true,
39    header_libs: [
40        "libberberis_guest_state_headers",
41    ],
42    export_header_lib_headers: [
43        "libberberis_guest_state_headers",
44    ],
45}
46
47cc_defaults {
48    name: "berberis_guest_state_defaults",
49    host_supported: true,
50    srcs: ["guest_state.cc"],
51    header_libs: [
52        "libberberis_base_headers",
53        "libnative_bridge_support_accessor_headers",
54    ],
55    // Targets using these defaults must provide the following guest-specific fields:
56    // header_libs: ["libberberis_guest_state_<guest>_headers"],
57    // export_header_lib_headers: ["libberberis_guest_state_<guest>_headers"],
58}
59
60cc_library_headers {
61    name: "libberberis_guest_state_riscv64_headers",
62    defaults: ["berberis_guest_state_headers_defaults"],
63    export_include_dirs: ["riscv64/include"],
64}
65
66cc_library_headers {
67    name: "libberberis_guest_state_arm64_headers",
68    defaults: ["berberis_guest_state_headers_defaults"],
69    export_include_dirs: ["arm64/include"],
70}
71
72cc_library_headers {
73    name: "libberberis_guest_state_arm_headers",
74    defaults: ["berberis_guest_state_headers_defaults"],
75    export_include_dirs: ["arm/include"],
76}
77
78cc_library_static {
79    name: "libberberis_guest_state_riscv64",
80    defaults: [
81        "berberis_defaults_64",
82        "berberis_guest_state_defaults",
83    ],
84    srcs: [
85        "riscv64/get_cpu_state.cc",
86        "riscv64/guest_state_arch.cc",
87    ],
88    header_libs: [
89        "libberberis_guest_state_riscv64_headers",
90    ],
91    export_header_lib_headers: ["libberberis_guest_state_riscv64_headers"],
92}
93
94cc_library_static {
95    name: "libberberis_guest_state_arm64",
96    defaults: [
97        "berberis_arm64_defaults",
98        "berberis_guest_state_defaults",
99    ],
100    srcs: [
101        "arm64/get_cpu_state.cc",
102        "arm64/guest_state_arch.cc",
103    ],
104    header_libs: [
105        "libberberis_guest_state_arm64_headers",
106    ],
107    export_header_lib_headers: ["libberberis_guest_state_arm64_headers"],
108}
109
110cc_library_static {
111    name: "libberberis_guest_state_arm",
112    defaults: [
113        "berberis_arm_defaults",
114        "berberis_guest_state_defaults",
115    ],
116    srcs: [
117        "arm/guest_state_arch.cc",
118    ],
119    header_libs: [
120        "libberberis_guest_state_arm_headers",
121    ],
122    export_header_lib_headers: ["libberberis_guest_state_arm_headers"],
123}
124
125cc_test_library {
126    name: "libberberis_cpu_state_riscv64_unit_test",
127    defaults: [
128        "berberis_test_library_defaults_64",
129        "berberis_guest_state_defaults",
130        "berberis_guest_state_headers_defaults",
131    ],
132    srcs: ["riscv64/get_cpu_state_test.cc"],
133    header_libs: ["libberberis_guest_state_riscv64_headers"],
134    export_header_lib_headers: ["libberberis_guest_state_riscv64_headers"],
135}
136
137cc_test_library {
138    name: "libberberis_cpu_state_arm64_unit_test",
139    defaults: [
140        "berberis_test_library_defaults_64",
141        "berberis_guest_state_defaults",
142        "berberis_guest_state_headers_defaults",
143    ],
144    srcs: ["arm64/get_cpu_state_test.cc"],
145    header_libs: ["libberberis_guest_state_arm64_headers"],
146    export_header_lib_headers: ["libberberis_guest_state_arm64_headers"],
147}
148