blob: b28582f6629adfc139fea7f2baa6006d79c08bf5 [file] [log] [blame]
David Sehr67bf42e2018-02-26 16:43:04 -08001//
2// Copyright (C) 2011 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
David Sehr8f4b0562018-03-02 12:01:51 -080017cc_defaults {
18 name: "libartbase_defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
21 srcs: [
22 "base/allocator.cc",
David Sehrc75f0af2018-04-05 11:02:03 -070023 "base/arena_allocator.cc",
24 "base/arena_bit_vector.cc",
David Sehr8f4b0562018-03-02 12:01:51 -080025 "base/bit_vector.cc",
26 "base/file_magic.cc",
27 "base/hex_dump.cc",
28 "base/logging.cc",
David Sehrc75f0af2018-04-05 11:02:03 -070029 "base/malloc_arena_pool.cc",
30 "base/memory_region.cc",
31 "base/mem_map.cc",
David Sehr8f4b0562018-03-02 12:01:51 -080032 "base/os_linux.cc",
33 "base/runtime_debug.cc",
34 "base/safe_copy.cc",
David Sehrc75f0af2018-04-05 11:02:03 -070035 "base/scoped_arena_allocator.cc",
David Sehr8f4b0562018-03-02 12:01:51 -080036 "base/scoped_flock.cc",
37 "base/time_utils.cc",
38 "base/unix_file/fd_file.cc",
39 "base/unix_file/random_access_file_utils.cc",
40 "base/utils.cc",
David Sehrc75f0af2018-04-05 11:02:03 -070041 "base/zip_archive.cc",
David Sehr8f4b0562018-03-02 12:01:51 -080042 ],
David Sehrc75f0af2018-04-05 11:02:03 -070043 target: {
44 android: {
45 static_libs: [
46 // ZipArchive support, the order matters here to get all symbols.
47 "libziparchive",
48 "libz",
49 ],
50 shared_libs: [
51 // For android::FileMap used by libziparchive.
52 "libutils",
53 ],
54 },
55 host: {
56 shared_libs: [
57 "libziparchive",
58 "libz",
59 ],
60 },
61 },
David Sehr8f4b0562018-03-02 12:01:51 -080062 generated_sources: ["art_libartbase_operator_srcs"],
63 cflags: ["-DBUILDING_LIBART=1"],
64 shared_libs: [
David Sehrc75f0af2018-04-05 11:02:03 -070065 "libbacktrace",
66 "liblog",
67 // For ashmem.
68 "libcutils",
David Sehr8f4b0562018-03-02 12:01:51 -080069 // For common macros.
70 "libbase",
David Sehr8f4b0562018-03-02 12:01:51 -080071 ],
72 export_include_dirs: ["."],
73 // ART's macros.h depends on libbase's macros.h.
74 // Note: runtime_options.h depends on cmdline. But we don't really want to export this
75 // generically. dex2oat takes care of it itself.
76 export_shared_lib_headers: ["libbase"],
77}
78
79gensrcs {
80 name: "art_libartbase_operator_srcs",
81 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
82 tools: ["generate_operator_out"],
83 srcs: [
84 "base/allocator.h",
85 "base/callee_save_type.h",
86 "base/unix_file/fd_file.h",
87 ],
88 output_extension: "operator_out.cc",
89}
90
91art_cc_library {
92 name: "libartbase",
93 defaults: ["libartbase_defaults"],
94 // Leave the symbols in the shared library so that stack unwinders can
95 // produce meaningful name resolution.
96 strip: {
97 keep_symbols: true,
98 },
David Sehrc75f0af2018-04-05 11:02:03 -070099 shared_libs: [
100 "libbase",
101 "libziparchive",
102 ],
David Sehr8f4b0562018-03-02 12:01:51 -0800103 export_shared_lib_headers: ["libbase"],
104}
105
106art_cc_library {
107 name: "libartbased",
108 defaults: [
109 "art_debug_defaults",
110 "libartbase_defaults",
111 ],
David Sehrc75f0af2018-04-05 11:02:03 -0700112 shared_libs: [
113 "libbase",
114 "libziparchive",
115 ],
David Sehr8f4b0562018-03-02 12:01:51 -0800116 export_shared_lib_headers: ["libbase"],
117}
118
119// For now many of these tests still use CommonRuntimeTest, almost universally because of
120// ScratchFile and related.
121// TODO: Remove CommonRuntimeTest dependency from these tests.
David Sehr67bf42e2018-02-26 16:43:04 -0800122art_cc_test {
123 name: "art_libartbase_tests",
124 defaults: [
125 "art_gtest_defaults",
126 ],
127 srcs: [
David Sehrc75f0af2018-04-05 11:02:03 -0700128 "base/arena_allocator_test.cc",
David Sehr8f4b0562018-03-02 12:01:51 -0800129 "base/bit_field_test.cc",
David Srbeckyb68db852018-05-10 17:49:33 +0100130 "base/bit_memory_region_test.cc",
David Sehr8f4b0562018-03-02 12:01:51 -0800131 "base/bit_string_test.cc",
132 "base/bit_struct_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800133 "base/bit_utils_test.cc",
David Sehr8f4b0562018-03-02 12:01:51 -0800134 "base/bit_vector_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800135 "base/hash_set_test.cc",
David Sehr8f4b0562018-03-02 12:01:51 -0800136 "base/hex_dump_test.cc",
137 "base/histogram_test.cc",
David Sehrc75f0af2018-04-05 11:02:03 -0700138 "base/indenter_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800139 "base/leb128_test.cc",
David Sehr8f4b0562018-03-02 12:01:51 -0800140 "base/logging_test.cc",
David Sehrc75f0af2018-04-05 11:02:03 -0700141 "base/memory_region_test.cc",
142 "base/mem_map_test.cc",
David Sehr8f4b0562018-03-02 12:01:51 -0800143 "base/safe_copy_test.cc",
144 "base/scoped_flock_test.cc",
145 "base/time_utils_test.cc",
146 "base/transform_array_ref_test.cc",
147 "base/transform_iterator_test.cc",
148 "base/unix_file/fd_file_test.cc",
149 "base/utils_test.cc",
150 "base/variant_map_test.cc",
David Sehrc75f0af2018-04-05 11:02:03 -0700151 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800152 ],
153 shared_libs: [
154 "libbase",
155 ],
156}
157
158cc_library_headers {
159 name: "art_libartbase_headers",
160 host_supported: true,
161 export_include_dirs: ["."],
162 shared_libs: ["libbase"],
163 export_shared_lib_headers: ["libbase"],
164}