blob: 32f464145910aca2508ba2165b2857011d12383e [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",
Eric Holkf1a2c0e2020-09-29 11:13:55 -070045 "base/metrics.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080046 "base/time_utils.cc",
47 "base/unix_file/fd_file.cc",
48 "base/unix_file/random_access_file_utils.cc",
49 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070050 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080051 ],
David Sehr79e26072018-04-06 17:58:50 -070052 target: {
53 android: {
David Sehr10db8fe2018-07-18 11:01:20 -070054 srcs: [
Martin Stjernholmc3723142020-09-23 01:17:33 +010055 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070056 "base/mem_map_unix.cc",
57 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000058 static_libs: [
59 // ZipArchive support, the order matters here to get all symbols.
60 "libziparchive",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000061 ],
David Sehr10db8fe2018-07-18 11:01:20 -070062 shared_libs: [
Jiyong Parkb1c8e162020-05-18 19:04:42 +090063 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070064 "liblog",
65 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000066 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070067 // For common macros.
68 "libbase",
69 ],
Martin Stjernholme407d972020-09-17 01:31:10 +010070 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -070071 },
David Sehr10db8fe2018-07-18 11:01:20 -070072 not_windows: {
73 srcs: [
Orion Hodsoncbe6d4a2019-05-09 10:29:52 +010074 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070075 "base/mem_map_unix.cc",
76 ],
Martin Stjernholma28438a2020-09-23 01:40:03 +010077 static: {
78 cflags: ["-DART_STATIC_LIBARTBASE"],
79 },
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000080 shared_libs: [
81 "libziparchive",
82 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070083 "liblog",
84 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000085 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070086 // For common macros.
87 "libbase",
David Sehr79e26072018-04-06 17:58:50 -070088 ],
Martin Stjernholme407d972020-09-17 01:31:10 +010089 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -070090 },
Martin Stjernholm43551622018-11-09 15:14:54 +000091 windows: {
David Sehr9d9227a2018-12-19 12:32:50 -080092 srcs: [
93 "base/mem_map_windows.cc",
94 ],
David Sehr10db8fe2018-07-18 11:01:20 -070095 static_libs: [
96 "libziparchive",
97 "libz",
98 "liblog",
99 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +0000100 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -0700101 // For common macros.
102 "libbase",
103 ],
Martin Stjernholme407d972020-09-17 01:31:10 +0100104 export_static_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
105
David Sehr10db8fe2018-07-18 11:01:20 -0700106 cflags: ["-Wno-thread-safety"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000107 },
David Srbeckyd53f6062019-03-22 14:55:21 +0000108 darwin: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700109 enabled: true, // for libdexfile.
David Srbeckyd53f6062019-03-22 14:55:21 +0000110 },
David Sehr79e26072018-04-06 17:58:50 -0700111 },
David Sehrc431b9d2018-03-02 12:01:51 -0800112 generated_sources: ["art_libartbase_operator_srcs"],
113 cflags: ["-DBUILDING_LIBART=1"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000114
David Sehrc431b9d2018-03-02 12:01:51 -0800115 export_include_dirs: ["."],
David Sehrc431b9d2018-03-02 12:01:51 -0800116}
117
Andreas Gampeec5ed062018-01-26 16:20:02 -0800118cc_defaults {
119 name: "libartbase_static_base_defaults",
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100120 whole_static_libs: [
Andreas Gampeec5ed062018-01-26 16:20:02 -0800121 "libbase",
Orion Hodson119733d2019-01-30 15:14:41 +0000122 "libartpalette",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800123 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000124 "libz",
125 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800126 ],
127}
128
129cc_defaults {
130 name: "libartbase_static_defaults",
131 defaults: ["libartbase_static_base_defaults"],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100132 whole_static_libs: ["libartbase"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800133}
134
135cc_defaults {
136 name: "libartbased_static_defaults",
137 defaults: ["libartbase_static_base_defaults"],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100138 whole_static_libs: ["libartbased"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800139}
140
David Sehrc431b9d2018-03-02 12:01:51 -0800141gensrcs {
142 name: "art_libartbase_operator_srcs",
143 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
144 tools: ["generate_operator_out"],
145 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700146 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800147 "base/allocator.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800148 "base/unix_file/fd_file.h",
149 ],
150 output_extension: "operator_out.cc",
151}
152
153art_cc_library {
154 name: "libartbase",
Christopher Ferris0d38e852019-12-11 09:37:19 -0800155 defaults: [
156 "libartbase_defaults",
157 "libart_nativeunwind_defaults",
158 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100159 visibility: [
160 // TODO(b/133140750): Clean this up.
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100161 "//packages/modules/NetworkStack/tests:__subpackages__",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100162 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000163 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100164 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +0000165 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +0000166 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100167
David Sehr79e26072018-04-06 17:58:50 -0700168 shared_libs: [
169 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000170 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700171 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800172 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700173 target: {
174 windows: {
175 enabled: true,
176 shared: {
177 enabled: false,
178 },
179 },
180 },
David Sehrc431b9d2018-03-02 12:01:51 -0800181}
182
183art_cc_library {
184 name: "libartbased",
185 defaults: [
186 "art_debug_defaults",
187 "libartbase_defaults",
188 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000189 apex_available: [
190 "com.android.art.debug",
191 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000192 shared_libs: [
193 "libbase",
194 "libziparchive",
195 ],
196 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700197 target: {
198 windows: {
199 enabled: true,
200 shared: {
201 enabled: false,
202 },
203 },
204 },
David Sehrc431b9d2018-03-02 12:01:51 -0800205}
206
David Sehrd5f8de82018-04-27 14:12:03 -0700207art_cc_library {
208 name: "libartbase-art-gtest",
209 defaults: ["libart-gtest-defaults"],
210 srcs: [
211 "base/common_art_test.cc",
212 ],
213 shared_libs: [
214 "libartbased",
215 "libdexfiled",
216 "libbase",
217 "libbacktrace",
218 ],
219 header_libs: [
220 "libnativehelper_header_only",
221 ],
Alex Light55153102019-05-08 17:03:10 -0700222 static: {
223 whole_static_libs: ["libc++fs"],
224 },
225 shared: {
226 static_libs: ["libc++fs"],
227 },
David Sehrd5f8de82018-04-27 14:12:03 -0700228}
229
David Sehr67bf42e2018-02-26 16:43:04 -0800230art_cc_test {
231 name: "art_libartbase_tests",
232 defaults: [
233 "art_gtest_defaults",
234 ],
235 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700236 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700237 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800238 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100239 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800240 "base/bit_string_test.cc",
241 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100242 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800243 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800244 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700245 "base/file_utils_test.cc",
Vladimir Marko33247ee2020-07-03 13:31:56 +0100246 "base/hash_map_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800247 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800248 "base/hex_dump_test.cc",
249 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700250 "base/indenter_test.cc",
Vladimir Marko3fae1292019-06-07 11:26:25 +0100251 "base/intrusive_forward_list_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800252 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800253 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100254 "base/memfd_test.cc",
255 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700256 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700257 "base/mem_map_test.cc",
Eric Holkf1a2c0e2020-09-29 11:13:55 -0700258 "base/metrics_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800259 "base/safe_copy_test.cc",
260 "base/scoped_flock_test.cc",
261 "base/time_utils_test.cc",
262 "base/transform_array_ref_test.cc",
263 "base/transform_iterator_test.cc",
264 "base/unix_file/fd_file_test.cc",
265 "base/utils_test.cc",
266 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700267 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800268 ],
269 shared_libs: [
270 "libbase",
271 ],
272}
273
274cc_library_headers {
275 name: "art_libartbase_headers",
276 host_supported: true,
277 export_include_dirs: ["."],
278 shared_libs: ["libbase"],
279 export_shared_lib_headers: ["libbase"],
Jiyong Park71f661c2020-04-28 18:20:43 +0900280
281 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100282 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900283 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +0900284 ],
David Sehr67bf42e2018-02-26 16:43:04 -0800285}