blob: 5845266e448c47dadfb5e3f8d1c40159f6804534 [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"],
Martin Stjernholm75b961a2020-05-07 01:45:27 +010020 visibility: [
21 // Visibility for prebuilt binaries from the prebuilt of this module.
22 // TODO(b/155921753): Restrict this when prebuilts are in their proper
23 // locations.
24 "//prebuilts:__subpackages__",
25 ],
David Sehrc431b9d2018-03-02 12:01:51 -080026 host_supported: true,
27 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -070028 "arch/instruction_set.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080029 "base/allocator.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070030 "base/arena_allocator.cc",
31 "base/arena_bit_vector.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080032 "base/bit_vector.cc",
Andreas Gampe8764dc32019-01-07 15:20:12 -080033 "base/enums.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080034 "base/file_magic.cc",
David Sehrc3e18952018-05-11 16:59:31 -070035 "base/file_utils.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080036 "base/hex_dump.cc",
David Brazdildcfa89b2018-10-31 11:04:10 +000037 "base/hiddenapi_flags.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080038 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070039 "base/malloc_arena_pool.cc",
Orion Hodson563ada22018-09-04 11:28:31 +010040 "base/membarrier.cc",
41 "base/memfd.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070042 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070043 "base/mem_map.cc",
Steve Austin882ed6b2018-06-08 11:40:38 -070044 // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong
David Sehrc431b9d2018-03-02 12:01:51 -080045 "base/os_linux.cc",
46 "base/runtime_debug.cc",
47 "base/safe_copy.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070048 "base/scoped_arena_allocator.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080049 "base/scoped_flock.cc",
Elliott Hughesc2efd4d2018-10-25 13:14:55 -070050 "base/socket_peer_is_trusted.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080051 "base/time_utils.cc",
52 "base/unix_file/fd_file.cc",
53 "base/unix_file/random_access_file_utils.cc",
54 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070055 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080056 ],
David Sehr79e26072018-04-06 17:58:50 -070057 target: {
58 android: {
David Sehr10db8fe2018-07-18 11:01:20 -070059 srcs: [
Martin Stjernholmc3723142020-09-23 01:17:33 +010060 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070061 "base/mem_map_unix.cc",
62 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000063 static_libs: [
64 // ZipArchive support, the order matters here to get all symbols.
65 "libziparchive",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000066 ],
David Sehr10db8fe2018-07-18 11:01:20 -070067 shared_libs: [
Jiyong Parkb1c8e162020-05-18 19:04:42 +090068 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070069 "liblog",
70 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000071 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070072 // For common macros.
73 "libbase",
74 ],
Martin Stjernholme407d972020-09-17 01:31:10 +010075 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -070076 },
David Sehr10db8fe2018-07-18 11:01:20 -070077 not_windows: {
78 srcs: [
Orion Hodsoncbe6d4a2019-05-09 10:29:52 +010079 "base/globals_unix.cc",
David Sehr10db8fe2018-07-18 11:01:20 -070080 "base/mem_map_unix.cc",
81 ],
Martin Stjernholma28438a2020-09-23 01:40:03 +010082 static: {
83 cflags: ["-DART_STATIC_LIBARTBASE"],
84 },
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000085 shared_libs: [
86 "libziparchive",
87 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070088 "liblog",
89 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000090 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070091 // For common macros.
92 "libbase",
David Sehr79e26072018-04-06 17:58:50 -070093 ],
Martin Stjernholme407d972020-09-17 01:31:10 +010094 export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
David Sehr79e26072018-04-06 17:58:50 -070095 },
Martin Stjernholm43551622018-11-09 15:14:54 +000096 windows: {
David Sehr9d9227a2018-12-19 12:32:50 -080097 srcs: [
98 "base/mem_map_windows.cc",
99 ],
David Sehr10db8fe2018-07-18 11:01:20 -0700100 static_libs: [
101 "libziparchive",
102 "libz",
103 "liblog",
104 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +0000105 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -0700106 // For common macros.
107 "libbase",
108 ],
Martin Stjernholme407d972020-09-17 01:31:10 +0100109 export_static_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
110
David Sehr10db8fe2018-07-18 11:01:20 -0700111 cflags: ["-Wno-thread-safety"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000112 },
David Srbeckyd53f6062019-03-22 14:55:21 +0000113 darwin: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700114 enabled: true, // for libdexfile.
David Srbeckyd53f6062019-03-22 14:55:21 +0000115 },
David Sehr79e26072018-04-06 17:58:50 -0700116 },
David Sehrc431b9d2018-03-02 12:01:51 -0800117 generated_sources: ["art_libartbase_operator_srcs"],
118 cflags: ["-DBUILDING_LIBART=1"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000119
David Sehrc431b9d2018-03-02 12:01:51 -0800120 export_include_dirs: ["."],
David Sehrc431b9d2018-03-02 12:01:51 -0800121}
122
Andreas Gampeec5ed062018-01-26 16:20:02 -0800123cc_defaults {
124 name: "libartbase_static_base_defaults",
125 static_libs: [
126 "libbase",
Orion Hodson119733d2019-01-30 15:14:41 +0000127 "libartpalette",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800128 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000129 "libz",
130 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800131 ],
132}
133
134cc_defaults {
135 name: "libartbase_static_defaults",
136 defaults: ["libartbase_static_base_defaults"],
137 static_libs: ["libartbase"],
138}
139
140cc_defaults {
141 name: "libartbased_static_defaults",
142 defaults: ["libartbase_static_base_defaults"],
143 static_libs: ["libartbased"],
144}
145
David Sehrc431b9d2018-03-02 12:01:51 -0800146gensrcs {
147 name: "art_libartbase_operator_srcs",
148 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
149 tools: ["generate_operator_out"],
150 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700151 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800152 "base/allocator.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800153 "base/unix_file/fd_file.h",
154 ],
155 output_extension: "operator_out.cc",
156}
157
158art_cc_library {
159 name: "libartbase",
Christopher Ferris0d38e852019-12-11 09:37:19 -0800160 defaults: [
161 "libartbase_defaults",
162 "libart_nativeunwind_defaults",
163 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100164 visibility: [
165 // TODO(b/133140750): Clean this up.
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100166 "//packages/modules/NetworkStack/tests:__subpackages__",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100167 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000168 apex_available: [
169 "com.android.art.release",
170 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +0000171 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100172
David Sehr79e26072018-04-06 17:58:50 -0700173 shared_libs: [
174 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000175 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700176 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800177 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700178 target: {
179 windows: {
180 enabled: true,
181 shared: {
182 enabled: false,
183 },
184 },
185 },
David Sehrc431b9d2018-03-02 12:01:51 -0800186}
187
188art_cc_library {
189 name: "libartbased",
190 defaults: [
191 "art_debug_defaults",
192 "libartbase_defaults",
193 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000194 apex_available: [
195 "com.android.art.debug",
196 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000197 shared_libs: [
198 "libbase",
199 "libziparchive",
200 ],
201 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700202 target: {
203 windows: {
204 enabled: true,
205 shared: {
206 enabled: false,
207 },
208 },
209 },
David Sehrc431b9d2018-03-02 12:01:51 -0800210}
211
David Sehrd5f8de82018-04-27 14:12:03 -0700212art_cc_library {
213 name: "libartbase-art-gtest",
214 defaults: ["libart-gtest-defaults"],
215 srcs: [
216 "base/common_art_test.cc",
217 ],
218 shared_libs: [
219 "libartbased",
220 "libdexfiled",
221 "libbase",
222 "libbacktrace",
223 ],
224 header_libs: [
225 "libnativehelper_header_only",
226 ],
Alex Light55153102019-05-08 17:03:10 -0700227 static: {
228 whole_static_libs: ["libc++fs"],
229 },
230 shared: {
231 static_libs: ["libc++fs"],
232 },
David Sehrd5f8de82018-04-27 14:12:03 -0700233}
234
David Sehr67bf42e2018-02-26 16:43:04 -0800235art_cc_test {
236 name: "art_libartbase_tests",
237 defaults: [
238 "art_gtest_defaults",
239 ],
240 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700241 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700242 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800243 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100244 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800245 "base/bit_string_test.cc",
246 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100247 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800248 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800249 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700250 "base/file_utils_test.cc",
Vladimir Marko33247ee2020-07-03 13:31:56 +0100251 "base/hash_map_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800252 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800253 "base/hex_dump_test.cc",
254 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700255 "base/indenter_test.cc",
Vladimir Marko3fae1292019-06-07 11:26:25 +0100256 "base/intrusive_forward_list_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800257 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800258 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100259 "base/memfd_test.cc",
260 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700261 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700262 "base/mem_map_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800263 "base/safe_copy_test.cc",
264 "base/scoped_flock_test.cc",
265 "base/time_utils_test.cc",
266 "base/transform_array_ref_test.cc",
267 "base/transform_iterator_test.cc",
268 "base/unix_file/fd_file_test.cc",
269 "base/utils_test.cc",
270 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700271 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800272 ],
273 shared_libs: [
274 "libbase",
275 ],
276}
277
278cc_library_headers {
279 name: "art_libartbase_headers",
280 host_supported: true,
281 export_include_dirs: ["."],
282 shared_libs: ["libbase"],
283 export_shared_lib_headers: ["libbase"],
Jiyong Park71f661c2020-04-28 18:20:43 +0900284
285 apex_available: [
286 "com.android.art.debug",
287 "com.android.art.release",
288 ],
David Sehr67bf42e2018-02-26 16:43:04 -0800289}