blob: 1b021195d64ef1cd3c39a2c3babad94c1b6f5615 [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
Bob Badour9150de62021-02-26 03:22:24 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "art_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["art_license"],
24}
25
David Sehrc431b9d2018-03-02 12:01:51 -080026cc_defaults {
27 name: "libartbase_defaults",
28 defaults: ["art_defaults"],
29 host_supported: true,
30 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -070031 "arch/instruction_set.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080032 "base/allocator.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070033 "base/arena_allocator.cc",
34 "base/arena_bit_vector.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080035 "base/bit_vector.cc",
Eric Holkc7ac91b2021-02-04 21:44:01 +000036 "base/compiler_filter.cc",
Andreas Gampe8764dc32019-01-07 15:20:12 -080037 "base/enums.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080038 "base/file_magic.cc",
David Sehrc3e18952018-05-11 16:59:31 -070039 "base/file_utils.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080040 "base/hex_dump.cc",
David Brazdildcfa89b2018-10-31 11:04:10 +000041 "base/hiddenapi_flags.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080042 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070043 "base/malloc_arena_pool.cc",
Orion Hodson563ada22018-09-04 11:28:31 +010044 "base/membarrier.cc",
45 "base/memfd.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070046 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070047 "base/mem_map.cc",
Steve Austin882ed6b2018-06-08 11:40:38 -070048 // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong
Eric Holk480d9812021-01-27 23:41:45 +000049 "base/metrics/metrics_common.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080050 "base/os_linux.cc",
51 "base/runtime_debug.cc",
52 "base/safe_copy.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070053 "base/scoped_arena_allocator.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080054 "base/scoped_flock.cc",
Elliott Hughesc2efd4d2018-10-25 13:14:55 -070055 "base/socket_peer_is_trusted.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080056 "base/time_utils.cc",
57 "base/unix_file/fd_file.cc",
58 "base/unix_file/random_access_file_utils.cc",
59 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070060 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080061 ],
David Sehr79e26072018-04-06 17:58:50 -070062 target: {
63 android: {
David Sehr10db8fe2018-07-18 11:01:20 -070064 srcs: [
Martin Stjernholmc3723142020-09-23 01:17:33 +010065 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070066 "base/mem_map_unix.cc",
67 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000068 static_libs: [
69 // ZipArchive support, the order matters here to get all symbols.
70 "libziparchive",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000071 ],
David Sehr10db8fe2018-07-18 11:01:20 -070072 shared_libs: [
Jiyong Parkb1c8e162020-05-18 19:04:42 +090073 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070074 "liblog",
75 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000076 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070077 // For common macros.
78 "libbase",
79 ],
Martin Stjernholme407d972020-09-17 01:31:10 +010080 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -070081 },
David Sehr10db8fe2018-07-18 11:01:20 -070082 not_windows: {
83 srcs: [
Orion Hodsoncbe6d4a2019-05-09 10:29:52 +010084 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070085 "base/mem_map_unix.cc",
86 ],
Martin Stjernholma28438a2020-09-23 01:40:03 +010087 static: {
88 cflags: ["-DART_STATIC_LIBARTBASE"],
89 },
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000090 shared_libs: [
91 "libziparchive",
92 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070093 "liblog",
94 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000095 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070096 // For common macros.
97 "libbase",
David Sehr79e26072018-04-06 17:58:50 -070098 ],
Martin Stjernholme407d972020-09-17 01:31:10 +010099 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -0700100 },
Martin Stjernholm43551622018-11-09 15:14:54 +0000101 windows: {
David Sehr9d9227a2018-12-19 12:32:50 -0800102 srcs: [
103 "base/mem_map_windows.cc",
104 ],
David Sehr10db8fe2018-07-18 11:01:20 -0700105 static_libs: [
106 "libziparchive",
107 "libz",
108 "liblog",
109 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +0000110 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -0700111 // For common macros.
112 "libbase",
113 ],
Martin Stjernholme407d972020-09-17 01:31:10 +0100114 export_static_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
115
David Sehr10db8fe2018-07-18 11:01:20 -0700116 cflags: ["-Wno-thread-safety"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000117 },
David Srbeckyd53f6062019-03-22 14:55:21 +0000118 darwin: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700119 enabled: true, // for libdexfile.
David Srbeckyd53f6062019-03-22 14:55:21 +0000120 },
David Sehr79e26072018-04-06 17:58:50 -0700121 },
David Sehrc431b9d2018-03-02 12:01:51 -0800122 generated_sources: ["art_libartbase_operator_srcs"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000123
David Sehrc431b9d2018-03-02 12:01:51 -0800124 export_include_dirs: ["."],
David Sehrc431b9d2018-03-02 12:01:51 -0800125}
126
Andreas Gampeec5ed062018-01-26 16:20:02 -0800127cc_defaults {
128 name: "libartbase_static_base_defaults",
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100129 whole_static_libs: [
Andreas Gampeec5ed062018-01-26 16:20:02 -0800130 "libbase",
Orion Hodson119733d2019-01-30 15:14:41 +0000131 "libartpalette",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800132 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000133 "libz",
134 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800135 ],
136}
137
138cc_defaults {
139 name: "libartbase_static_defaults",
140 defaults: ["libartbase_static_base_defaults"],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100141 whole_static_libs: ["libartbase"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800142}
143
144cc_defaults {
145 name: "libartbased_static_defaults",
146 defaults: ["libartbase_static_base_defaults"],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100147 whole_static_libs: ["libartbased"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800148}
149
David Sehrc431b9d2018-03-02 12:01:51 -0800150gensrcs {
151 name: "art_libartbase_operator_srcs",
152 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
153 tools: ["generate_operator_out"],
154 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700155 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800156 "base/allocator.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800157 "base/unix_file/fd_file.h",
158 ],
159 output_extension: "operator_out.cc",
160}
161
162art_cc_library {
163 name: "libartbase",
Christopher Ferris0d38e852019-12-11 09:37:19 -0800164 defaults: [
165 "libartbase_defaults",
166 "libart_nativeunwind_defaults",
Yi Kongf579b062020-10-24 22:54:39 +0800167 "art_pgo_defaults",
Christopher Ferris0d38e852019-12-11 09:37:19 -0800168 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100169 visibility: [
Martin Stjernholm4312f742021-03-23 00:30:57 +0000170 // TODO(b/183483755): Please visibility checks when the prebuilt
171 // libartbase is present but not preferred, and the prebuilt libdexfile
172 // hence depends on the source instead.
173 // TODO(b/172480617): Alternatively, clean up when we no longer need to
174 // support both prebuilts and sources present simultaneously.
175 "//prebuilts/module_sdk/art/current/host-exports",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100176 // TODO(b/133140750): Clean this up.
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100177 "//packages/modules/NetworkStack/tests:__subpackages__",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100178 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000179 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100180 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +0000181 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +0000182 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100183
David Sehr79e26072018-04-06 17:58:50 -0700184 shared_libs: [
185 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000186 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700187 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800188 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700189 target: {
190 windows: {
191 enabled: true,
192 shared: {
193 enabled: false,
194 },
195 },
196 },
David Sehrc431b9d2018-03-02 12:01:51 -0800197}
198
199art_cc_library {
200 name: "libartbased",
201 defaults: [
202 "art_debug_defaults",
203 "libartbase_defaults",
204 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000205 apex_available: [
206 "com.android.art.debug",
207 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000208 shared_libs: [
209 "libbase",
210 "libziparchive",
211 ],
212 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700213 target: {
214 windows: {
215 enabled: true,
216 shared: {
217 enabled: false,
218 },
219 },
220 },
David Sehrc431b9d2018-03-02 12:01:51 -0800221}
222
David Sehrd5f8de82018-04-27 14:12:03 -0700223art_cc_library {
224 name: "libartbase-art-gtest",
225 defaults: ["libart-gtest-defaults"],
226 srcs: [
227 "base/common_art_test.cc",
228 ],
229 shared_libs: [
230 "libartbased",
231 "libdexfiled",
232 "libbase",
233 "libbacktrace",
234 ],
235 header_libs: [
236 "libnativehelper_header_only",
237 ],
Alex Light55153102019-05-08 17:03:10 -0700238 static: {
239 whole_static_libs: ["libc++fs"],
240 },
241 shared: {
242 static_libs: ["libc++fs"],
243 },
David Sehrd5f8de82018-04-27 14:12:03 -0700244}
245
David Sehr67bf42e2018-02-26 16:43:04 -0800246art_cc_test {
247 name: "art_libartbase_tests",
248 defaults: [
249 "art_gtest_defaults",
250 ],
251 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700252 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700253 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800254 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100255 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800256 "base/bit_string_test.cc",
257 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100258 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800259 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800260 "base/bit_vector_test.cc",
Eric Holkc7ac91b2021-02-04 21:44:01 +0000261 "base/compiler_filter_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700262 "base/file_utils_test.cc",
Vladimir Marko33247ee2020-07-03 13:31:56 +0100263 "base/hash_map_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800264 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800265 "base/hex_dump_test.cc",
266 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700267 "base/indenter_test.cc",
Vladimir Marko3fae1292019-06-07 11:26:25 +0100268 "base/intrusive_forward_list_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800269 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800270 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100271 "base/memfd_test.cc",
272 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700273 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700274 "base/mem_map_test.cc",
Eric Holk480d9812021-01-27 23:41:45 +0000275 "base/metrics/metrics_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800276 "base/safe_copy_test.cc",
277 "base/scoped_flock_test.cc",
278 "base/time_utils_test.cc",
279 "base/transform_array_ref_test.cc",
280 "base/transform_iterator_test.cc",
281 "base/unix_file/fd_file_test.cc",
282 "base/utils_test.cc",
283 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700284 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800285 ],
286 shared_libs: [
287 "libbase",
288 ],
289}
290
291cc_library_headers {
292 name: "art_libartbase_headers",
293 host_supported: true,
294 export_include_dirs: ["."],
295 shared_libs: ["libbase"],
296 export_shared_lib_headers: ["libbase"],
Jiyong Park71f661c2020-04-28 18:20:43 +0900297
298 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100299 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900300 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +0900301 ],
Nicolas Geoffrayec388c02021-03-03 22:09:06 +0000302 min_sdk_version: "S",
David Sehr67bf42e2018-02-26 16:43:04 -0800303}