blob: cb0721bb711371ab7a0d5e58fece588296cbdcfe [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",
Andreas Gampe8764dc32019-01-07 15:20:12 -080027 "base/enums.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080028 "base/file_magic.cc",
David Sehrc3e18952018-05-11 16:59:31 -070029 "base/file_utils.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080030 "base/hex_dump.cc",
David Brazdildcfa89b2018-10-31 11:04:10 +000031 "base/hiddenapi_flags.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080032 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070033 "base/malloc_arena_pool.cc",
Orion Hodson563ada22018-09-04 11:28:31 +010034 "base/membarrier.cc",
35 "base/memfd.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070036 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070037 "base/mem_map.cc",
Steve Austin882ed6b2018-06-08 11:40:38 -070038 // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong
David Sehrc431b9d2018-03-02 12:01:51 -080039 "base/os_linux.cc",
40 "base/runtime_debug.cc",
41 "base/safe_copy.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070042 "base/scoped_arena_allocator.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080043 "base/scoped_flock.cc",
Elliott Hughesc2efd4d2018-10-25 13:14:55 -070044 "base/socket_peer_is_trusted.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080045 "base/time_utils.cc",
46 "base/unix_file/fd_file.cc",
47 "base/unix_file/random_access_file_utils.cc",
48 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070049 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080050 ],
David Sehr79e26072018-04-06 17:58:50 -070051 target: {
52 android: {
David Sehr10db8fe2018-07-18 11:01:20 -070053 srcs: [
54 "base/mem_map_unix.cc",
55 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000056 static_libs: [
57 // ZipArchive support, the order matters here to get all symbols.
58 "libziparchive",
59 "libz",
60 ],
David Sehr10db8fe2018-07-18 11:01:20 -070061 shared_libs: [
62 "liblog",
63 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000064 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070065 // For common macros.
66 "libbase",
67 ],
David Sehr9d9227a2018-12-19 12:32:50 -080068 export_shared_lib_headers: ["libbase"],
Martin Stjernholm43551622018-11-09 15:14:54 +000069 // Exclude the version script from Darwin host since it's not
70 // supported by the linker there. That means ASan checks on Darwin
71 // might trigger ODR violations.
72 version_script: "libartbase.map",
David Sehr79e26072018-04-06 17:58:50 -070073 },
David Sehr10db8fe2018-07-18 11:01:20 -070074 not_windows: {
75 srcs: [
Orion Hodsoncbe6d4a2019-05-09 10:29:52 +010076 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070077 "base/mem_map_unix.cc",
78 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000079 shared_libs: [
80 "libziparchive",
81 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070082 "liblog",
83 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000084 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070085 // For common macros.
86 "libbase",
David Sehr79e26072018-04-06 17:58:50 -070087 ],
David Sehr9d9227a2018-12-19 12:32:50 -080088 export_shared_lib_headers: ["libbase"],
David Sehr79e26072018-04-06 17:58:50 -070089 },
Martin Stjernholm43551622018-11-09 15:14:54 +000090 linux_glibc: {
91 version_script: "libartbase.map",
92 },
93 windows: {
94 version_script: "libartbase.map",
David Sehr9d9227a2018-12-19 12:32:50 -080095 srcs: [
96 "base/mem_map_windows.cc",
97 ],
David Sehr10db8fe2018-07-18 11:01:20 -070098 static_libs: [
99 "libziparchive",
100 "libz",
101 "liblog",
102 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +0000103 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -0700104 // For common macros.
105 "libbase",
106 ],
David Sehr9d9227a2018-12-19 12:32:50 -0800107 export_static_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700108 cflags: ["-Wno-thread-safety"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000109 },
David Srbeckyd53f6062019-03-22 14:55:21 +0000110 darwin: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700111 enabled: true, // for libdexfile.
David Srbeckyd53f6062019-03-22 14:55:21 +0000112 },
David Sehr79e26072018-04-06 17:58:50 -0700113 },
David Sehrc431b9d2018-03-02 12:01:51 -0800114 generated_sources: ["art_libartbase_operator_srcs"],
115 cflags: ["-DBUILDING_LIBART=1"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000116
117 // Utilities used by various ART libs and tools are linked in statically
118 // here to avoid shared lib dependencies outside the ART APEX. No target
119 // there should depend on these separately.
120 whole_static_libs: [
121 "liblz4",
122 "liblzma",
123 ],
124
David Sehrc431b9d2018-03-02 12:01:51 -0800125 export_include_dirs: ["."],
126 // ART's macros.h depends on libbase's macros.h.
127 // Note: runtime_options.h depends on cmdline. But we don't really want to export this
128 // generically. dex2oat takes care of it itself.
David Sehrc431b9d2018-03-02 12:01:51 -0800129}
130
Andreas Gampeec5ed062018-01-26 16:20:02 -0800131cc_defaults {
132 name: "libartbase_static_base_defaults",
133 static_libs: [
134 "libbase",
Orion Hodson119733d2019-01-30 15:14:41 +0000135 "libartpalette",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800136 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000137 "libz",
138 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800139 ],
140}
141
142cc_defaults {
143 name: "libartbase_static_defaults",
144 defaults: ["libartbase_static_base_defaults"],
145 static_libs: ["libartbase"],
146}
147
148cc_defaults {
149 name: "libartbased_static_defaults",
150 defaults: ["libartbase_static_base_defaults"],
151 static_libs: ["libartbased"],
152}
153
David Sehrc431b9d2018-03-02 12:01:51 -0800154gensrcs {
155 name: "art_libartbase_operator_srcs",
156 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
157 tools: ["generate_operator_out"],
158 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700159 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800160 "base/allocator.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800161 "base/unix_file/fd_file.h",
162 ],
163 output_extension: "operator_out.cc",
164}
165
166art_cc_library {
167 name: "libartbase",
168 defaults: ["libartbase_defaults"],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100169 visibility: [
170 // TODO(b/133140750): Clean this up.
171 "//cts/tests/tests/appop",
172 "//frameworks/base/startop/view_compiler",
173 "//frameworks/base/tests/net:__subpackages__",
174 "//packages/modules/NetworkStack/tests:__subpackages__",
175 "//system/extras/simpleperf",
176 ],
177
David Sehrc431b9d2018-03-02 12:01:51 -0800178 // Leave the symbols in the shared library so that stack unwinders can
179 // produce meaningful name resolution.
180 strip: {
181 keep_symbols: true,
182 },
David Sehr79e26072018-04-06 17:58:50 -0700183 shared_libs: [
184 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000185 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700186 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800187 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700188 target: {
189 windows: {
190 enabled: true,
191 shared: {
192 enabled: false,
193 },
194 },
195 },
David Sehrc431b9d2018-03-02 12:01:51 -0800196}
197
198art_cc_library {
199 name: "libartbased",
200 defaults: [
201 "art_debug_defaults",
202 "libartbase_defaults",
203 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000204 shared_libs: [
205 "libbase",
206 "libziparchive",
207 ],
208 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700209 target: {
210 windows: {
211 enabled: true,
212 shared: {
213 enabled: false,
214 },
215 },
216 },
David Sehrc431b9d2018-03-02 12:01:51 -0800217}
218
David Sehrd5f8de82018-04-27 14:12:03 -0700219art_cc_library {
220 name: "libartbase-art-gtest",
221 defaults: ["libart-gtest-defaults"],
222 srcs: [
223 "base/common_art_test.cc",
224 ],
225 shared_libs: [
226 "libartbased",
227 "libdexfiled",
228 "libbase",
229 "libbacktrace",
230 ],
231 header_libs: [
232 "libnativehelper_header_only",
233 ],
Alex Light55153102019-05-08 17:03:10 -0700234 static: {
235 whole_static_libs: ["libc++fs"],
236 },
237 shared: {
238 static_libs: ["libc++fs"],
239 },
David Sehrd5f8de82018-04-27 14:12:03 -0700240}
241
David Sehr67bf42e2018-02-26 16:43:04 -0800242art_cc_test {
243 name: "art_libartbase_tests",
244 defaults: [
245 "art_gtest_defaults",
246 ],
247 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700248 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700249 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800250 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100251 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800252 "base/bit_string_test.cc",
253 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100254 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800255 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800256 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700257 "base/file_utils_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800258 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800259 "base/hex_dump_test.cc",
260 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700261 "base/indenter_test.cc",
Vladimir Marko3fae1292019-06-07 11:26:25 +0100262 "base/intrusive_forward_list_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800263 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800264 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100265 "base/memfd_test.cc",
266 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700267 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700268 "base/mem_map_test.cc",
Orion Hodson077872d2019-03-06 11:00:52 +0000269 "base/memory_type_table_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800270 "base/safe_copy_test.cc",
271 "base/scoped_flock_test.cc",
272 "base/time_utils_test.cc",
273 "base/transform_array_ref_test.cc",
274 "base/transform_iterator_test.cc",
275 "base/unix_file/fd_file_test.cc",
276 "base/utils_test.cc",
277 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700278 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800279 ],
280 shared_libs: [
281 "libbase",
282 ],
283}
284
285cc_library_headers {
286 name: "art_libartbase_headers",
287 host_supported: true,
288 export_include_dirs: ["."],
289 shared_libs: ["libbase"],
290 export_shared_lib_headers: ["libbase"],
291}