David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 1 | // |
| 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 Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 17 | cc_defaults { |
| 18 | name: "libartbase_defaults", |
| 19 | defaults: ["art_defaults"], |
Martin Stjernholm | 75b961a | 2020-05-07 01:45:27 +0100 | [diff] [blame] | 20 | 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 Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 26 | host_supported: true, |
| 27 | srcs: [ |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 28 | "arch/instruction_set.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 29 | "base/allocator.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 30 | "base/arena_allocator.cc", |
| 31 | "base/arena_bit_vector.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 32 | "base/bit_vector.cc", |
Andreas Gampe | 8764dc3 | 2019-01-07 15:20:12 -0800 | [diff] [blame] | 33 | "base/enums.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 34 | "base/file_magic.cc", |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 35 | "base/file_utils.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 36 | "base/hex_dump.cc", |
David Brazdil | dcfa89b | 2018-10-31 11:04:10 +0000 | [diff] [blame] | 37 | "base/hiddenapi_flags.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 38 | "base/logging.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 39 | "base/malloc_arena_pool.cc", |
Orion Hodson | 563ada2 | 2018-09-04 11:28:31 +0100 | [diff] [blame] | 40 | "base/membarrier.cc", |
| 41 | "base/memfd.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 42 | "base/memory_region.cc", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 43 | "base/mem_map.cc", |
Steve Austin | 882ed6b | 2018-06-08 11:40:38 -0700 | [diff] [blame] | 44 | // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 45 | "base/os_linux.cc", |
| 46 | "base/runtime_debug.cc", |
| 47 | "base/safe_copy.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 48 | "base/scoped_arena_allocator.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 49 | "base/scoped_flock.cc", |
Elliott Hughes | c2efd4d | 2018-10-25 13:14:55 -0700 | [diff] [blame] | 50 | "base/socket_peer_is_trusted.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 51 | "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 Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 55 | "base/zip_archive.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 56 | ], |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 57 | target: { |
| 58 | android: { |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 59 | srcs: [ |
Martin Stjernholm | c372314 | 2020-09-23 01:17:33 +0100 | [diff] [blame] | 60 | "base/globals_unix.cc", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 61 | "base/mem_map_unix.cc", |
| 62 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 63 | static_libs: [ |
| 64 | // ZipArchive support, the order matters here to get all symbols. |
| 65 | "libziparchive", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 66 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 67 | shared_libs: [ |
Jiyong Park | b1c8e16 | 2020-05-18 19:04:42 +0900 | [diff] [blame] | 68 | "libz", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 69 | "liblog", |
| 70 | // For ashmem. |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 71 | "libartpalette", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 72 | // For common macros. |
| 73 | "libbase", |
| 74 | ], |
Martin Stjernholm | e407d97 | 2020-09-17 01:31:10 +0100 | [diff] [blame] | 75 | export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h. |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 76 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 77 | not_windows: { |
| 78 | srcs: [ |
Orion Hodson | cbe6d4a | 2019-05-09 10:29:52 +0100 | [diff] [blame] | 79 | "base/globals_unix.cc", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 80 | "base/mem_map_unix.cc", |
| 81 | ], |
Martin Stjernholm | a28438a | 2020-09-23 01:40:03 +0100 | [diff] [blame^] | 82 | static: { |
| 83 | cflags: ["-DART_STATIC_LIBARTBASE"], |
| 84 | }, |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 85 | shared_libs: [ |
| 86 | "libziparchive", |
| 87 | "libz", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 88 | "liblog", |
| 89 | // For ashmem. |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 90 | "libartpalette", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 91 | // For common macros. |
| 92 | "libbase", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 93 | ], |
Martin Stjernholm | e407d97 | 2020-09-17 01:31:10 +0100 | [diff] [blame] | 94 | export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h. |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 95 | }, |
Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame] | 96 | windows: { |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 97 | srcs: [ |
| 98 | "base/mem_map_windows.cc", |
| 99 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 100 | static_libs: [ |
| 101 | "libziparchive", |
| 102 | "libz", |
| 103 | "liblog", |
| 104 | // For ashmem. |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 105 | "libartpalette", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 106 | // For common macros. |
| 107 | "libbase", |
| 108 | ], |
Martin Stjernholm | e407d97 | 2020-09-17 01:31:10 +0100 | [diff] [blame] | 109 | export_static_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h. |
| 110 | |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 111 | cflags: ["-Wno-thread-safety"], |
Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame] | 112 | }, |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 113 | darwin: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 114 | enabled: true, // for libdexfile. |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 115 | }, |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 116 | }, |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 117 | generated_sources: ["art_libartbase_operator_srcs"], |
| 118 | cflags: ["-DBUILDING_LIBART=1"], |
Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame] | 119 | |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 120 | export_include_dirs: ["."], |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 121 | } |
| 122 | |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 123 | cc_defaults { |
| 124 | name: "libartbase_static_base_defaults", |
| 125 | static_libs: [ |
| 126 | "libbase", |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 127 | "libartpalette", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 128 | "liblog", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 129 | "libz", |
| 130 | "libziparchive", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 131 | ], |
| 132 | } |
| 133 | |
| 134 | cc_defaults { |
| 135 | name: "libartbase_static_defaults", |
| 136 | defaults: ["libartbase_static_base_defaults"], |
| 137 | static_libs: ["libartbase"], |
| 138 | } |
| 139 | |
| 140 | cc_defaults { |
| 141 | name: "libartbased_static_defaults", |
| 142 | defaults: ["libartbase_static_base_defaults"], |
| 143 | static_libs: ["libartbased"], |
| 144 | } |
| 145 | |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 146 | gensrcs { |
| 147 | name: "art_libartbase_operator_srcs", |
| 148 | cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)", |
| 149 | tools: ["generate_operator_out"], |
| 150 | srcs: [ |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 151 | "arch/instruction_set.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 152 | "base/allocator.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 153 | "base/unix_file/fd_file.h", |
| 154 | ], |
| 155 | output_extension: "operator_out.cc", |
| 156 | } |
| 157 | |
| 158 | art_cc_library { |
| 159 | name: "libartbase", |
Christopher Ferris | 0d38e85 | 2019-12-11 09:37:19 -0800 | [diff] [blame] | 160 | defaults: [ |
| 161 | "libartbase_defaults", |
| 162 | "libart_nativeunwind_defaults", |
| 163 | ], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 164 | visibility: [ |
| 165 | // TODO(b/133140750): Clean this up. |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 166 | "//packages/modules/NetworkStack/tests:__subpackages__", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 167 | ], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 168 | apex_available: [ |
| 169 | "com.android.art.release", |
| 170 | "com.android.art.debug", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 171 | ], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 172 | |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 173 | shared_libs: [ |
| 174 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 175 | "libziparchive", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 176 | ], |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 177 | export_shared_lib_headers: ["libbase"], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 178 | target: { |
| 179 | windows: { |
| 180 | enabled: true, |
| 181 | shared: { |
| 182 | enabled: false, |
| 183 | }, |
| 184 | }, |
| 185 | }, |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | art_cc_library { |
| 189 | name: "libartbased", |
| 190 | defaults: [ |
| 191 | "art_debug_defaults", |
| 192 | "libartbase_defaults", |
| 193 | ], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 194 | apex_available: [ |
| 195 | "com.android.art.debug", |
| 196 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 197 | shared_libs: [ |
| 198 | "libbase", |
| 199 | "libziparchive", |
| 200 | ], |
| 201 | export_shared_lib_headers: ["libbase"], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 202 | target: { |
| 203 | windows: { |
| 204 | enabled: true, |
| 205 | shared: { |
| 206 | enabled: false, |
| 207 | }, |
| 208 | }, |
| 209 | }, |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 210 | } |
| 211 | |
David Sehr | d5f8de8 | 2018-04-27 14:12:03 -0700 | [diff] [blame] | 212 | art_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 Light | 5515310 | 2019-05-08 17:03:10 -0700 | [diff] [blame] | 227 | static: { |
| 228 | whole_static_libs: ["libc++fs"], |
| 229 | }, |
| 230 | shared: { |
| 231 | static_libs: ["libc++fs"], |
| 232 | }, |
David Sehr | d5f8de8 | 2018-04-27 14:12:03 -0700 | [diff] [blame] | 233 | } |
| 234 | |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 235 | art_cc_test { |
| 236 | name: "art_libartbase_tests", |
| 237 | defaults: [ |
| 238 | "art_gtest_defaults", |
| 239 | ], |
| 240 | srcs: [ |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 241 | "arch/instruction_set_test.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 242 | "base/arena_allocator_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 243 | "base/bit_field_test.cc", |
David Srbecky | 68fefac | 2018-05-10 17:49:33 +0100 | [diff] [blame] | 244 | "base/bit_memory_region_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 245 | "base/bit_string_test.cc", |
| 246 | "base/bit_struct_test.cc", |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 247 | "base/bit_table_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 248 | "base/bit_utils_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 249 | "base/bit_vector_test.cc", |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 250 | "base/file_utils_test.cc", |
Vladimir Marko | 33247ee | 2020-07-03 13:31:56 +0100 | [diff] [blame] | 251 | "base/hash_map_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 252 | "base/hash_set_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 253 | "base/hex_dump_test.cc", |
| 254 | "base/histogram_test.cc", |
David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 255 | "base/indenter_test.cc", |
Vladimir Marko | 3fae129 | 2019-06-07 11:26:25 +0100 | [diff] [blame] | 256 | "base/intrusive_forward_list_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 257 | "base/leb128_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 258 | "base/logging_test.cc", |
Orion Hodson | 563ada2 | 2018-09-04 11:28:31 +0100 | [diff] [blame] | 259 | "base/memfd_test.cc", |
| 260 | "base/membarrier_test.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 261 | "base/memory_region_test.cc", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 262 | "base/mem_map_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 263 | "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 Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 271 | "base/zip_archive_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 272 | ], |
| 273 | shared_libs: [ |
| 274 | "libbase", |
| 275 | ], |
| 276 | } |
| 277 | |
| 278 | cc_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 Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 284 | |
| 285 | apex_available: [ |
| 286 | "com.android.art.debug", |
| 287 | "com.android.art.release", |
| 288 | ], |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 289 | } |