blob: adf0ad6376a057da22217bc0e1ec7a9dda25b9c3 [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 Sehrc431b9d2018-03-02 12:01:51 -080017cc_defaults {
18 name: "libartbase_defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
21 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -070022 "arch/instruction_set.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080023 "base/allocator.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070024 "base/arena_allocator.cc",
25 "base/arena_bit_vector.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080026 "base/bit_vector.cc",
27 "base/file_magic.cc",
David Sehrc3e18952018-05-11 16:59:31 -070028 "base/file_utils.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080029 "base/hex_dump.cc",
30 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070031 "base/malloc_arena_pool.cc",
32 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070033 "base/mem_map.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080034 "base/os_linux.cc",
35 "base/runtime_debug.cc",
36 "base/safe_copy.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070037 "base/scoped_arena_allocator.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080038 "base/scoped_flock.cc",
39 "base/time_utils.cc",
40 "base/unix_file/fd_file.cc",
41 "base/unix_file/random_access_file_utils.cc",
42 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070043 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080044 ],
David Sehr79e26072018-04-06 17:58:50 -070045 target: {
46 android: {
47 static_libs: [
48 // ZipArchive support, the order matters here to get all symbols.
49 "libziparchive",
50 "libz",
51 ],
52 shared_libs: [
53 // For android::FileMap used by libziparchive.
54 "libutils",
55 ],
56 },
57 host: {
58 shared_libs: [
59 "libziparchive",
60 "libz",
61 ],
62 },
63 },
David Sehrc431b9d2018-03-02 12:01:51 -080064 generated_sources: ["art_libartbase_operator_srcs"],
65 cflags: ["-DBUILDING_LIBART=1"],
66 shared_libs: [
David Sehr79e26072018-04-06 17:58:50 -070067 "liblog",
68 // For ashmem.
69 "libcutils",
David Sehrc431b9d2018-03-02 12:01:51 -080070 // For common macros.
71 "libbase",
David Sehrc431b9d2018-03-02 12:01:51 -080072 ],
73 export_include_dirs: ["."],
74 // ART's macros.h depends on libbase's macros.h.
75 // Note: runtime_options.h depends on cmdline. But we don't really want to export this
76 // generically. dex2oat takes care of it itself.
77 export_shared_lib_headers: ["libbase"],
78}
79
80gensrcs {
81 name: "art_libartbase_operator_srcs",
82 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
83 tools: ["generate_operator_out"],
84 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -070085 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -080086 "base/allocator.h",
87 "base/callee_save_type.h",
88 "base/unix_file/fd_file.h",
89 ],
90 output_extension: "operator_out.cc",
91}
92
93art_cc_library {
94 name: "libartbase",
95 defaults: ["libartbase_defaults"],
96 // Leave the symbols in the shared library so that stack unwinders can
97 // produce meaningful name resolution.
98 strip: {
99 keep_symbols: true,
100 },
David Sehr79e26072018-04-06 17:58:50 -0700101 shared_libs: [
102 "libbase",
103 "libziparchive",
104 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800105 export_shared_lib_headers: ["libbase"],
106}
107
108art_cc_library {
109 name: "libartbased",
110 defaults: [
111 "art_debug_defaults",
112 "libartbase_defaults",
113 ],
David Sehr79e26072018-04-06 17:58:50 -0700114 shared_libs: [
115 "libbase",
116 "libziparchive",
117 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800118 export_shared_lib_headers: ["libbase"],
119}
120
David Sehrd5f8de82018-04-27 14:12:03 -0700121art_cc_library {
122 name: "libartbase-art-gtest",
123 defaults: ["libart-gtest-defaults"],
124 srcs: [
125 "base/common_art_test.cc",
126 ],
127 shared_libs: [
128 "libartbased",
129 "libdexfiled",
130 "libbase",
131 "libbacktrace",
132 ],
133 header_libs: [
134 "libnativehelper_header_only",
135 ],
136 include_dirs: [
137 "external/icu/icu4c/source/common",
138 ],
139}
140
David Sehr67bf42e2018-02-26 16:43:04 -0800141art_cc_test {
142 name: "art_libartbase_tests",
143 defaults: [
144 "art_gtest_defaults",
145 ],
146 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700147 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700148 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800149 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100150 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800151 "base/bit_string_test.cc",
152 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100153 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800154 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800155 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700156 "base/file_utils_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800157 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800158 "base/hex_dump_test.cc",
159 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700160 "base/indenter_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800161 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800162 "base/logging_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700163 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700164 "base/mem_map_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800165 "base/safe_copy_test.cc",
166 "base/scoped_flock_test.cc",
167 "base/time_utils_test.cc",
168 "base/transform_array_ref_test.cc",
169 "base/transform_iterator_test.cc",
170 "base/unix_file/fd_file_test.cc",
171 "base/utils_test.cc",
172 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700173 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800174 ],
175 shared_libs: [
176 "libbase",
177 ],
178}
179
180cc_library_headers {
181 name: "art_libartbase_headers",
182 host_supported: true,
183 export_include_dirs: ["."],
184 shared_libs: ["libbase"],
185 export_shared_lib_headers: ["libbase"],
186}