blob: 8bd3bd12aa1172db67089b142df525f10699ee38 [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",
Calin Juravle09eacd92021-05-19 17:03:55 -070040 "base/flags.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080041 "base/hex_dump.cc",
David Brazdildcfa89b2018-10-31 11:04:10 +000042 "base/hiddenapi_flags.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080043 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070044 "base/malloc_arena_pool.cc",
Orion Hodson563ada22018-09-04 11:28:31 +010045 "base/membarrier.cc",
46 "base/memfd.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070047 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070048 "base/mem_map.cc",
Steve Austin882ed6b2018-06-08 11:40:38 -070049 // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong
Eric Holk480d9812021-01-27 23:41:45 +000050 "base/metrics/metrics_common.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080051 "base/os_linux.cc",
52 "base/runtime_debug.cc",
53 "base/safe_copy.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070054 "base/scoped_arena_allocator.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080055 "base/scoped_flock.cc",
Elliott Hughesc2efd4d2018-10-25 13:14:55 -070056 "base/socket_peer_is_trusted.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080057 "base/time_utils.cc",
58 "base/unix_file/fd_file.cc",
59 "base/unix_file/random_access_file_utils.cc",
60 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070061 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080062 ],
David Sehr79e26072018-04-06 17:58:50 -070063 target: {
64 android: {
David Sehr10db8fe2018-07-18 11:01:20 -070065 srcs: [
Martin Stjernholmc3723142020-09-23 01:17:33 +010066 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070067 "base/mem_map_unix.cc",
68 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000069 static_libs: [
70 // ZipArchive support, the order matters here to get all symbols.
71 "libziparchive",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000072 ],
David Sehr10db8fe2018-07-18 11:01:20 -070073 shared_libs: [
Jiyong Parkb1c8e162020-05-18 19:04:42 +090074 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070075 "liblog",
76 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000077 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070078 // For common macros.
79 "libbase",
80 ],
Martin Stjernholme407d972020-09-17 01:31:10 +010081 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -070082 },
David Sehr10db8fe2018-07-18 11:01:20 -070083 not_windows: {
84 srcs: [
Orion Hodsoncbe6d4a2019-05-09 10:29:52 +010085 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070086 "base/mem_map_unix.cc",
87 ],
Martin Stjernholma28438a2020-09-23 01:40:03 +010088 static: {
89 cflags: ["-DART_STATIC_LIBARTBASE"],
90 },
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000091 shared_libs: [
92 "libziparchive",
93 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070094 "liblog",
95 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000096 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070097 // For common macros.
98 "libbase",
David Sehr79e26072018-04-06 17:58:50 -070099 ],
Martin Stjernholme407d972020-09-17 01:31:10 +0100100 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -0700101 },
Martin Stjernholm43551622018-11-09 15:14:54 +0000102 windows: {
David Sehr9d9227a2018-12-19 12:32:50 -0800103 srcs: [
104 "base/mem_map_windows.cc",
105 ],
David Sehr10db8fe2018-07-18 11:01:20 -0700106 static_libs: [
107 "libziparchive",
108 "libz",
109 "liblog",
110 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +0000111 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -0700112 // For common macros.
113 "libbase",
114 ],
Martin Stjernholme407d972020-09-17 01:31:10 +0100115 export_static_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
116
David Sehr10db8fe2018-07-18 11:01:20 -0700117 cflags: ["-Wno-thread-safety"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000118 },
David Srbeckyd53f6062019-03-22 14:55:21 +0000119 darwin: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700120 enabled: true, // for libdexfile.
David Srbeckyd53f6062019-03-22 14:55:21 +0000121 },
David Sehr79e26072018-04-06 17:58:50 -0700122 },
David Sehrc431b9d2018-03-02 12:01:51 -0800123 generated_sources: ["art_libartbase_operator_srcs"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000124
David Sehrc431b9d2018-03-02 12:01:51 -0800125 export_include_dirs: ["."],
David Sehrc431b9d2018-03-02 12:01:51 -0800126}
127
Andreas Gampeec5ed062018-01-26 16:20:02 -0800128cc_defaults {
129 name: "libartbase_static_base_defaults",
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100130 whole_static_libs: [
Andreas Gampeec5ed062018-01-26 16:20:02 -0800131 "libbase",
Orion Hodson119733d2019-01-30 15:14:41 +0000132 "libartpalette",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800133 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000134 "libz",
135 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800136 ],
137}
138
139cc_defaults {
140 name: "libartbase_static_defaults",
141 defaults: ["libartbase_static_base_defaults"],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100142 whole_static_libs: ["libartbase"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800143}
144
145cc_defaults {
146 name: "libartbased_static_defaults",
147 defaults: ["libartbase_static_base_defaults"],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100148 whole_static_libs: ["libartbased"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800149}
150
David Sehrc431b9d2018-03-02 12:01:51 -0800151gensrcs {
152 name: "art_libartbase_operator_srcs",
153 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
154 tools: ["generate_operator_out"],
155 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700156 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800157 "base/allocator.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800158 "base/unix_file/fd_file.h",
159 ],
160 output_extension: "operator_out.cc",
161}
162
163art_cc_library {
164 name: "libartbase",
Christopher Ferris0d38e852019-12-11 09:37:19 -0800165 defaults: [
166 "libartbase_defaults",
167 "libart_nativeunwind_defaults",
Yi Kongf579b062020-10-24 22:54:39 +0800168 "art_pgo_defaults",
Christopher Ferris0d38e852019-12-11 09:37:19 -0800169 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100170 visibility: [
Martin Stjernholm4312f742021-03-23 00:30:57 +0000171 // TODO(b/183483755): Please visibility checks when the prebuilt
172 // libartbase is present but not preferred, and the prebuilt libdexfile
173 // hence depends on the source instead.
174 // TODO(b/172480617): Alternatively, clean up when we no longer need to
175 // support both prebuilts and sources present simultaneously.
176 "//prebuilts/module_sdk/art/current/host-exports",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100177 // TODO(b/133140750): Clean this up.
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100178 "//packages/modules/NetworkStack/tests:__subpackages__",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100179 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000180 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100181 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +0000182 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +0000183 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100184
David Sehr79e26072018-04-06 17:58:50 -0700185 shared_libs: [
186 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000187 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700188 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800189 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700190 target: {
191 windows: {
192 enabled: true,
193 shared: {
194 enabled: false,
195 },
196 },
197 },
David Sehrc431b9d2018-03-02 12:01:51 -0800198}
199
200art_cc_library {
201 name: "libartbased",
202 defaults: [
203 "art_debug_defaults",
204 "libartbase_defaults",
205 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000206 apex_available: [
207 "com.android.art.debug",
208 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000209 shared_libs: [
210 "libbase",
211 "libziparchive",
212 ],
213 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700214 target: {
215 windows: {
216 enabled: true,
217 shared: {
218 enabled: false,
219 },
220 },
221 },
David Sehrc431b9d2018-03-02 12:01:51 -0800222}
223
Roland Levillainf0409142021-03-22 15:45:03 +0000224art_cc_defaults {
225 name: "libartbase-art-gtest-defaults",
David Sehrd5f8de82018-04-27 14:12:03 -0700226 srcs: [
227 "base/common_art_test.cc",
228 ],
229 shared_libs: [
David Sehrd5f8de82018-04-27 14:12:03 -0700230 "libbase",
231 "libbacktrace",
232 ],
233 header_libs: [
234 "libnativehelper_header_only",
235 ],
Alex Light55153102019-05-08 17:03:10 -0700236 static: {
237 whole_static_libs: ["libc++fs"],
238 },
239 shared: {
240 static_libs: ["libc++fs"],
241 },
David Sehrd5f8de82018-04-27 14:12:03 -0700242}
243
Roland Levillainf0409142021-03-22 15:45:03 +0000244art_cc_library {
245 name: "libartbase-art-gtest",
David Sehr67bf42e2018-02-26 16:43:04 -0800246 defaults: [
Roland Levillainf0409142021-03-22 15:45:03 +0000247 "libart-gtest-defaults",
248 "libartbase-art-gtest-defaults",
David Sehr67bf42e2018-02-26 16:43:04 -0800249 ],
Roland Levillainf0409142021-03-22 15:45:03 +0000250 shared_libs: [
251 "libartbase",
252 "libdexfile",
253 ],
254}
255
256art_cc_library {
257 name: "libartbased-art-gtest",
258 defaults: [
259 "libartd-gtest-defaults",
260 "libartbase-art-gtest-defaults",
261 ],
262 shared_libs: [
263 "libartbased",
264 "libdexfiled",
265 ],
266}
267
268art_cc_defaults {
269 name: "art_libartbase_tests_defaults",
David Sehr67bf42e2018-02-26 16:43:04 -0800270 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700271 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700272 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800273 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100274 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800275 "base/bit_string_test.cc",
276 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100277 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800278 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800279 "base/bit_vector_test.cc",
Eric Holkc7ac91b2021-02-04 21:44:01 +0000280 "base/compiler_filter_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700281 "base/file_utils_test.cc",
Calin Juravle09eacd92021-05-19 17:03:55 -0700282 "base/flags_test.cc",
Vladimir Marko33247ee2020-07-03 13:31:56 +0100283 "base/hash_map_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800284 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800285 "base/hex_dump_test.cc",
286 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700287 "base/indenter_test.cc",
Vladimir Marko3fae1292019-06-07 11:26:25 +0100288 "base/intrusive_forward_list_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800289 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800290 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100291 "base/memfd_test.cc",
292 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700293 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700294 "base/mem_map_test.cc",
Eric Holk480d9812021-01-27 23:41:45 +0000295 "base/metrics/metrics_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800296 "base/safe_copy_test.cc",
297 "base/scoped_flock_test.cc",
298 "base/time_utils_test.cc",
299 "base/transform_array_ref_test.cc",
300 "base/transform_iterator_test.cc",
301 "base/unix_file/fd_file_test.cc",
302 "base/utils_test.cc",
303 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700304 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800305 ],
306 shared_libs: [
307 "libbase",
308 ],
Roland Levillainf0409142021-03-22 15:45:03 +0000309 static_libs: [
310 "libgmock",
311 ],
312}
313
314// Version of ART gtest `art_libartbase_tests` bundled with the ART APEX on target.
315// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
316art_cc_test {
317 name: "art_libartbase_tests",
318 defaults: [
319 "art_gtest_defaults",
320 "art_libartbase_tests_defaults",
321 ],
322}
323
324// Standalone version of ART gtest `art_libartbase_tests`, not bundled with the ART APEX on target.
325art_cc_test {
326 name: "art_standalone_libartbase_tests",
327 defaults: [
328 "art_standalone_gtest_defaults",
329 "art_libartbase_tests_defaults",
330 ],
David Sehr67bf42e2018-02-26 16:43:04 -0800331}
332
333cc_library_headers {
334 name: "art_libartbase_headers",
335 host_supported: true,
336 export_include_dirs: ["."],
337 shared_libs: ["libbase"],
338 export_shared_lib_headers: ["libbase"],
Jiyong Park71f661c2020-04-28 18:20:43 +0900339
340 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100341 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900342 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +0900343 ],
Nicolas Geoffrayec388c02021-03-03 22:09:06 +0000344 min_sdk_version: "S",
David Sehr67bf42e2018-02-26 16:43:04 -0800345}