blob: 58d12a1e041eae001bca41170552f3764bb93767 [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",
27 "base/file_magic.cc",
David Sehrc3e18952018-05-11 16:59:31 -070028 "base/file_utils.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080029 "base/hex_dump.cc",
David Brazdildcfa89b2018-10-31 11:04:10 +000030 "base/hiddenapi_flags.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080031 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070032 "base/malloc_arena_pool.cc",
Orion Hodson563ada22018-09-04 11:28:31 +010033 "base/membarrier.cc",
34 "base/memfd.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070035 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070036 "base/mem_map.cc",
Steve Austin882ed6b2018-06-08 11:40:38 -070037 // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong
38 "base/mem_map_unix.cc",
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: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000053 static_libs: [
54 // ZipArchive support, the order matters here to get all symbols.
55 "libziparchive",
56 "libz",
57 ],
Martin Stjernholm43551622018-11-09 15:14:54 +000058 // Exclude the version script from Darwin host since it's not
59 // supported by the linker there. That means ASan checks on Darwin
60 // might trigger ODR violations.
61 version_script: "libartbase.map",
David Sehr79e26072018-04-06 17:58:50 -070062 },
63 host: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000064 shared_libs: [
65 "libziparchive",
66 "libz",
David Sehr79e26072018-04-06 17:58:50 -070067 ],
68 },
Martin Stjernholm43551622018-11-09 15:14:54 +000069 linux_glibc: {
70 version_script: "libartbase.map",
71 },
72 windows: {
73 version_script: "libartbase.map",
74 },
David Sehr79e26072018-04-06 17:58:50 -070075 },
David Sehrc431b9d2018-03-02 12:01:51 -080076 generated_sources: ["art_libartbase_operator_srcs"],
77 cflags: ["-DBUILDING_LIBART=1"],
78 shared_libs: [
David Sehr79e26072018-04-06 17:58:50 -070079 "liblog",
Martin Stjernholm43551622018-11-09 15:14:54 +000080 // For ashmem.
David Sehr79e26072018-04-06 17:58:50 -070081 "libcutils",
David Sehrc431b9d2018-03-02 12:01:51 -080082 // For common macros.
83 "libbase",
David Sehrc431b9d2018-03-02 12:01:51 -080084 ],
Martin Stjernholm43551622018-11-09 15:14:54 +000085
86 // Utilities used by various ART libs and tools are linked in statically
87 // here to avoid shared lib dependencies outside the ART APEX. No target
88 // there should depend on these separately.
89 whole_static_libs: [
90 "liblz4",
91 "liblzma",
92 ],
93
David Sehrc431b9d2018-03-02 12:01:51 -080094 export_include_dirs: ["."],
95 // ART's macros.h depends on libbase's macros.h.
96 // Note: runtime_options.h depends on cmdline. But we don't really want to export this
97 // generically. dex2oat takes care of it itself.
98 export_shared_lib_headers: ["libbase"],
99}
100
Andreas Gampeec5ed062018-01-26 16:20:02 -0800101cc_defaults {
102 name: "libartbase_static_base_defaults",
103 static_libs: [
104 "libbase",
105 "libcutils",
106 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000107 "libz",
108 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800109 ],
110}
111
112cc_defaults {
113 name: "libartbase_static_defaults",
114 defaults: ["libartbase_static_base_defaults"],
115 static_libs: ["libartbase"],
116}
117
118cc_defaults {
119 name: "libartbased_static_defaults",
120 defaults: ["libartbase_static_base_defaults"],
121 static_libs: ["libartbased"],
122}
123
David Sehrc431b9d2018-03-02 12:01:51 -0800124gensrcs {
125 name: "art_libartbase_operator_srcs",
126 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
127 tools: ["generate_operator_out"],
128 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700129 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800130 "base/allocator.h",
131 "base/callee_save_type.h",
132 "base/unix_file/fd_file.h",
133 ],
134 output_extension: "operator_out.cc",
135}
136
137art_cc_library {
138 name: "libartbase",
139 defaults: ["libartbase_defaults"],
140 // Leave the symbols in the shared library so that stack unwinders can
141 // produce meaningful name resolution.
142 strip: {
143 keep_symbols: true,
144 },
David Sehr79e26072018-04-06 17:58:50 -0700145 shared_libs: [
146 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000147 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700148 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800149 export_shared_lib_headers: ["libbase"],
150}
151
152art_cc_library {
153 name: "libartbased",
154 defaults: [
155 "art_debug_defaults",
156 "libartbase_defaults",
157 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000158 shared_libs: [
159 "libbase",
160 "libziparchive",
161 ],
162 export_shared_lib_headers: ["libbase"],
David Sehrc431b9d2018-03-02 12:01:51 -0800163}
164
David Sehrd5f8de82018-04-27 14:12:03 -0700165art_cc_library {
166 name: "libartbase-art-gtest",
167 defaults: ["libart-gtest-defaults"],
168 srcs: [
169 "base/common_art_test.cc",
170 ],
171 shared_libs: [
172 "libartbased",
173 "libdexfiled",
174 "libbase",
175 "libbacktrace",
176 ],
177 header_libs: [
178 "libnativehelper_header_only",
179 ],
180 include_dirs: [
181 "external/icu/icu4c/source/common",
182 ],
183}
184
David Sehr67bf42e2018-02-26 16:43:04 -0800185art_cc_test {
186 name: "art_libartbase_tests",
187 defaults: [
188 "art_gtest_defaults",
189 ],
190 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700191 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700192 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800193 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100194 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800195 "base/bit_string_test.cc",
196 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100197 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800198 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800199 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700200 "base/file_utils_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800201 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800202 "base/hex_dump_test.cc",
203 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700204 "base/indenter_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800205 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800206 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100207 "base/memfd_test.cc",
208 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700209 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700210 "base/mem_map_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800211 "base/safe_copy_test.cc",
212 "base/scoped_flock_test.cc",
213 "base/time_utils_test.cc",
214 "base/transform_array_ref_test.cc",
215 "base/transform_iterator_test.cc",
216 "base/unix_file/fd_file_test.cc",
217 "base/utils_test.cc",
218 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700219 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800220 ],
221 shared_libs: [
222 "libbase",
223 ],
224}
225
226cc_library_headers {
227 name: "art_libartbase_headers",
228 host_supported: true,
229 export_include_dirs: ["."],
230 shared_libs: ["libbase"],
231 export_shared_lib_headers: ["libbase"],
232}