blob: 5010f683d7c23b7065302f90dcccb8929446e9ec [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 ],
David Sehr79e26072018-04-06 17:58:50 -070057 },
58 host: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000059 shared_libs: [
60 "libziparchive",
61 "libz",
David Sehr79e26072018-04-06 17:58:50 -070062 ],
63 },
64 },
David Sehrc431b9d2018-03-02 12:01:51 -080065 generated_sources: ["art_libartbase_operator_srcs"],
66 cflags: ["-DBUILDING_LIBART=1"],
67 shared_libs: [
David Sehr79e26072018-04-06 17:58:50 -070068 "liblog",
69 // For ashmem.
70 "libcutils",
David Sehrc431b9d2018-03-02 12:01:51 -080071 // For common macros.
72 "libbase",
David Sehrc431b9d2018-03-02 12:01:51 -080073 ],
74 export_include_dirs: ["."],
75 // ART's macros.h depends on libbase's macros.h.
76 // Note: runtime_options.h depends on cmdline. But we don't really want to export this
77 // generically. dex2oat takes care of it itself.
78 export_shared_lib_headers: ["libbase"],
79}
80
Andreas Gampeec5ed062018-01-26 16:20:02 -080081cc_defaults {
82 name: "libartbase_static_base_defaults",
83 static_libs: [
84 "libbase",
85 "libcutils",
86 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000087 "libz",
88 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -080089 ],
90}
91
92cc_defaults {
93 name: "libartbase_static_defaults",
94 defaults: ["libartbase_static_base_defaults"],
95 static_libs: ["libartbase"],
96}
97
98cc_defaults {
99 name: "libartbased_static_defaults",
100 defaults: ["libartbase_static_base_defaults"],
101 static_libs: ["libartbased"],
102}
103
David Sehrc431b9d2018-03-02 12:01:51 -0800104gensrcs {
105 name: "art_libartbase_operator_srcs",
106 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
107 tools: ["generate_operator_out"],
108 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700109 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800110 "base/allocator.h",
111 "base/callee_save_type.h",
112 "base/unix_file/fd_file.h",
113 ],
114 output_extension: "operator_out.cc",
115}
116
117art_cc_library {
118 name: "libartbase",
119 defaults: ["libartbase_defaults"],
120 // Leave the symbols in the shared library so that stack unwinders can
121 // produce meaningful name resolution.
122 strip: {
123 keep_symbols: true,
124 },
David Sehr79e26072018-04-06 17:58:50 -0700125 shared_libs: [
126 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000127 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700128 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800129 export_shared_lib_headers: ["libbase"],
130}
131
132art_cc_library {
133 name: "libartbased",
134 defaults: [
135 "art_debug_defaults",
136 "libartbase_defaults",
137 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000138 shared_libs: [
139 "libbase",
140 "libziparchive",
141 ],
142 export_shared_lib_headers: ["libbase"],
David Sehrc431b9d2018-03-02 12:01:51 -0800143}
144
David Sehrd5f8de82018-04-27 14:12:03 -0700145art_cc_library {
146 name: "libartbase-art-gtest",
147 defaults: ["libart-gtest-defaults"],
148 srcs: [
149 "base/common_art_test.cc",
150 ],
151 shared_libs: [
152 "libartbased",
153 "libdexfiled",
154 "libbase",
155 "libbacktrace",
156 ],
157 header_libs: [
158 "libnativehelper_header_only",
159 ],
160 include_dirs: [
161 "external/icu/icu4c/source/common",
162 ],
163}
164
David Sehr67bf42e2018-02-26 16:43:04 -0800165art_cc_test {
166 name: "art_libartbase_tests",
167 defaults: [
168 "art_gtest_defaults",
169 ],
170 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700171 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700172 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800173 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100174 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800175 "base/bit_string_test.cc",
176 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100177 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800178 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800179 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700180 "base/file_utils_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800181 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800182 "base/hex_dump_test.cc",
183 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700184 "base/indenter_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800185 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800186 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100187 "base/memfd_test.cc",
188 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700189 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700190 "base/mem_map_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800191 "base/safe_copy_test.cc",
192 "base/scoped_flock_test.cc",
193 "base/time_utils_test.cc",
194 "base/transform_array_ref_test.cc",
195 "base/transform_iterator_test.cc",
196 "base/unix_file/fd_file_test.cc",
197 "base/utils_test.cc",
198 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700199 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800200 ],
201 shared_libs: [
202 "libbase",
203 ],
204}
205
206cc_library_headers {
207 name: "art_libartbase_headers",
208 host_supported: true,
209 export_include_dirs: ["."],
210 shared_libs: ["libbase"],
211 export_shared_lib_headers: ["libbase"],
212}