blob: 6a667bc7a7b852f25e3a666dcf2517d621b42bfe [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",
30 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070031 "base/malloc_arena_pool.cc",
Orion Hodson563ada22018-09-04 11:28:31 +010032 "base/membarrier.cc",
33 "base/memfd.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070034 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070035 "base/mem_map.cc",
Steve Austin882ed6b2018-06-08 11:40:38 -070036 // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong
37 "base/mem_map_unix.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080038 "base/os_linux.cc",
39 "base/runtime_debug.cc",
40 "base/safe_copy.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070041 "base/scoped_arena_allocator.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080042 "base/scoped_flock.cc",
Elliott Hughesc2efd4d2018-10-25 13:14:55 -070043 "base/socket_peer_is_trusted.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080044 "base/time_utils.cc",
45 "base/unix_file/fd_file.cc",
46 "base/unix_file/random_access_file_utils.cc",
47 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070048 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080049 ],
David Sehr79e26072018-04-06 17:58:50 -070050 target: {
51 android: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000052 static_libs: [
53 // ZipArchive support, the order matters here to get all symbols.
54 "libziparchive",
55 "libz",
56 ],
Martin Stjernholm43551622018-11-09 15:14:54 +000057 // Exclude the version script from Darwin host since it's not
58 // supported by the linker there. That means ASan checks on Darwin
59 // might trigger ODR violations.
60 version_script: "libartbase.map",
David Sehr79e26072018-04-06 17:58:50 -070061 },
62 host: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000063 shared_libs: [
64 "libziparchive",
65 "libz",
David Sehr79e26072018-04-06 17:58:50 -070066 ],
67 },
Martin Stjernholm43551622018-11-09 15:14:54 +000068 linux_glibc: {
69 version_script: "libartbase.map",
70 },
71 windows: {
72 version_script: "libartbase.map",
73 },
David Sehr79e26072018-04-06 17:58:50 -070074 },
David Sehrc431b9d2018-03-02 12:01:51 -080075 generated_sources: ["art_libartbase_operator_srcs"],
76 cflags: ["-DBUILDING_LIBART=1"],
77 shared_libs: [
David Sehr79e26072018-04-06 17:58:50 -070078 "liblog",
Martin Stjernholm43551622018-11-09 15:14:54 +000079 // For ashmem.
David Sehr79e26072018-04-06 17:58:50 -070080 "libcutils",
David Sehrc431b9d2018-03-02 12:01:51 -080081 // For common macros.
82 "libbase",
David Sehrc431b9d2018-03-02 12:01:51 -080083 ],
Martin Stjernholm43551622018-11-09 15:14:54 +000084
85 // Utilities used by various ART libs and tools are linked in statically
86 // here to avoid shared lib dependencies outside the ART APEX. No target
87 // there should depend on these separately.
88 whole_static_libs: [
89 "liblz4",
90 "liblzma",
91 ],
92
David Sehrc431b9d2018-03-02 12:01:51 -080093 export_include_dirs: ["."],
94 // ART's macros.h depends on libbase's macros.h.
95 // Note: runtime_options.h depends on cmdline. But we don't really want to export this
96 // generically. dex2oat takes care of it itself.
97 export_shared_lib_headers: ["libbase"],
98}
99
Andreas Gampeec5ed062018-01-26 16:20:02 -0800100cc_defaults {
101 name: "libartbase_static_base_defaults",
102 static_libs: [
103 "libbase",
104 "libcutils",
105 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000106 "libz",
107 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800108 ],
109}
110
111cc_defaults {
112 name: "libartbase_static_defaults",
113 defaults: ["libartbase_static_base_defaults"],
114 static_libs: ["libartbase"],
115}
116
117cc_defaults {
118 name: "libartbased_static_defaults",
119 defaults: ["libartbase_static_base_defaults"],
120 static_libs: ["libartbased"],
121}
122
David Sehrc431b9d2018-03-02 12:01:51 -0800123gensrcs {
124 name: "art_libartbase_operator_srcs",
125 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
126 tools: ["generate_operator_out"],
127 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700128 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800129 "base/allocator.h",
130 "base/callee_save_type.h",
131 "base/unix_file/fd_file.h",
132 ],
133 output_extension: "operator_out.cc",
134}
135
136art_cc_library {
137 name: "libartbase",
138 defaults: ["libartbase_defaults"],
139 // Leave the symbols in the shared library so that stack unwinders can
140 // produce meaningful name resolution.
141 strip: {
142 keep_symbols: true,
143 },
David Sehr79e26072018-04-06 17:58:50 -0700144 shared_libs: [
145 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000146 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700147 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800148 export_shared_lib_headers: ["libbase"],
149}
150
151art_cc_library {
152 name: "libartbased",
153 defaults: [
154 "art_debug_defaults",
155 "libartbase_defaults",
156 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000157 shared_libs: [
158 "libbase",
159 "libziparchive",
160 ],
161 export_shared_lib_headers: ["libbase"],
David Sehrc431b9d2018-03-02 12:01:51 -0800162}
163
David Sehrd5f8de82018-04-27 14:12:03 -0700164art_cc_library {
165 name: "libartbase-art-gtest",
166 defaults: ["libart-gtest-defaults"],
167 srcs: [
168 "base/common_art_test.cc",
169 ],
170 shared_libs: [
171 "libartbased",
172 "libdexfiled",
173 "libbase",
174 "libbacktrace",
175 ],
176 header_libs: [
177 "libnativehelper_header_only",
178 ],
179 include_dirs: [
180 "external/icu/icu4c/source/common",
181 ],
182}
183
David Sehr67bf42e2018-02-26 16:43:04 -0800184art_cc_test {
185 name: "art_libartbase_tests",
186 defaults: [
187 "art_gtest_defaults",
188 ],
189 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700190 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700191 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800192 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100193 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800194 "base/bit_string_test.cc",
195 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100196 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800197 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800198 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700199 "base/file_utils_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800200 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800201 "base/hex_dump_test.cc",
202 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700203 "base/indenter_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800204 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800205 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100206 "base/memfd_test.cc",
207 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700208 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700209 "base/mem_map_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800210 "base/safe_copy_test.cc",
211 "base/scoped_flock_test.cc",
212 "base/time_utils_test.cc",
213 "base/transform_array_ref_test.cc",
214 "base/transform_iterator_test.cc",
215 "base/unix_file/fd_file_test.cc",
216 "base/utils_test.cc",
217 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700218 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800219 ],
220 shared_libs: [
221 "libbase",
222 ],
223}
224
225cc_library_headers {
226 name: "art_libartbase_headers",
227 host_supported: true,
228 export_include_dirs: ["."],
229 shared_libs: ["libbase"],
230 export_shared_lib_headers: ["libbase"],
231}