• Home
  • History
  • Annotate
  • 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_base_headers",
22    defaults: ["berberis_defaults"],
23    host_supported: true,
24    export_include_dirs: ["include"],
25    header_libs: ["libbase_headers"],
26    export_header_lib_headers: ["libbase_headers"],
27}
28
29cc_library_static {
30    name: "libberberis_base",
31    defaults: ["berberis_defaults"],
32    host_supported: true,
33    srcs: [
34        "config_globals.cc",
35        "config_globals_custom.cc",
36        "exec_region.cc",
37        "exec_region_anonymous.cc",
38        "format_buffer.cc",
39        "large_mmap.cc",
40        "mapped_file_fragment.cc",
41        "memfd_backed_mmap.cc",
42        "mmap_posix.cc",
43        "prctl_helpers.cc",
44        "tracing.cc",
45    ],
46    arch: {
47        x86: {
48            srcs: ["raw_syscall_x86_32.S"],
49        },
50        x86_64: {
51            srcs: ["raw_syscall_x86_64.S"],
52        },
53    },
54    target: {
55        bionic: {
56            srcs: ["exec_region_elf_backed.cc"],
57        },
58    },
59
60    header_libs: ["libberberis_base_headers"],
61    export_header_lib_headers: ["libberberis_base_headers"],
62}
63
64cc_test_library {
65    name: "libberberis_base_unit_tests",
66    defaults: ["berberis_test_library_defaults"],
67    srcs: [
68        "arena_test.cc",
69        "arena_zeroed_array_test.cc",
70        "bit_util_test.cc",
71        "exec_region_anonymous.cc",
72        "exec_region_anonymous_test.cc",
73        "forever_alloc_test.cc",
74        "forever_pool_test.cc",
75        "format_buffer_test.cc",
76        "lock_free_stack_test.cc",
77        "large_mmap_test.cc",
78        "memfd_backed_mmap_test.cc",
79        "mmap_pool_test.cc",
80        "pointer_and_counter_test.cc",
81    ],
82    target: {
83        bionic: {
84            srcs: ["exec_region_elf_backed_test.cc"],
85        },
86    },
87    header_libs: ["libberberis_base_headers"],
88}
89