• 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_defaults {
21    name: "berberis_defaults",
22    cflags: [
23        "-Wall",
24        "-Werror",
25        "-Wextra",
26        "-Wmost",
27        "-Wover-aligned",
28        "-Wunused",
29        "-Wimplicit-fallthrough",
30        "-Wdefaulted-function-deleted",
31    ],
32    // It is tempting to disable builds by default and explicitly enable only x86.
33    // Unfortunately that way disabling darwin has no effect. So instead
34    // we disable unneeded targets individually.
35    target: {
36        darwin: {
37            enabled: false,
38        },
39    },
40    arch: {
41        arm: {
42            enabled: false,
43        },
44        arm64: {
45            enabled: false,
46        },
47        riscv64: {
48            enabled: false,
49        },
50    },
51    compile_multilib: "both",
52    // Only check our headers.
53    tidy_flags: [
54        "-header-filter=^frameworks/libs/binary_translation/",
55    ],
56    tidy_checks: [
57        "modernize*",
58        "-modernize-use-trailing-return-type",
59    ],
60}
61
62cc_defaults {
63    name: "berberis_defaults_64",
64    defaults: ["berberis_defaults"],
65    compile_multilib: "64",
66}
67
68cc_defaults {
69    name: "berberis_test_library_defaults",
70    defaults: ["berberis_defaults"],
71    host_supported: true,
72    shared: {
73        enabled: false,
74    },
75}
76
77cc_defaults {
78    name: "berberis_test_library_defaults_64",
79    defaults: ["berberis_test_library_defaults"],
80    compile_multilib: "64",
81}
82
83cc_test_host {
84    name: "berberis_host_tests",
85    defaults: ["berberis_defaults"],
86    static_libs: [
87        "libberberis_assembler",
88        "libberberis_base",
89        "libberberis_config_globals",
90        "libberberis_tinyloader",
91    ],
92    shared_libs: [
93        "libbase",
94        "liblog",
95    ],
96    whole_static_libs: [
97        "libberberis_assembler_unit_tests",
98        "libberberis_base_unit_tests",
99        "libberberis_intrinsics_unit_tests",
100        "libberberis_tinyloader_unit_tests",
101    ],
102    arch: {
103        x86: {
104            srcs: [
105                "base/raw_syscall_tests.cc",
106            ],
107        },
108        x86_64: {
109            srcs: [
110                "base/raw_syscall_tests.cc",
111            ],
112            static_libs: [
113                "libberberis_interpreter_riscv64",
114                "libberberis_kernel_api_riscv64",
115                "libberberis_runtime",
116            ],
117            whole_static_libs: [
118                "libberberis_interpreter_riscv64_unit_tests",
119                "libberberis_runtime_unit_tests",
120            ],
121        },
122    },
123    data: [
124        "tiny_loader/tests/files/32/*",
125        "tiny_loader/tests/files/64/*",
126    ],
127    test_suites: ["device-tests"],
128    test_options: {
129        unit_test: true,
130    },
131}
132