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"], |
| 20 | host_supported: true, |
| 21 | srcs: [ |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 22 | "arch/instruction_set.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 23 | "base/allocator.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 24 | "base/arena_allocator.cc", |
| 25 | "base/arena_bit_vector.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 26 | "base/bit_vector.cc", |
Andreas Gampe | 8764dc3 | 2019-01-07 15:20:12 -0800 | [diff] [blame] | 27 | "base/enums.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 28 | "base/file_magic.cc", |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 29 | "base/file_utils.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 30 | "base/hex_dump.cc", |
David Brazdil | dcfa89b | 2018-10-31 11:04:10 +0000 | [diff] [blame] | 31 | "base/hiddenapi_flags.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 32 | "base/logging.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 33 | "base/malloc_arena_pool.cc", |
Orion Hodson | 563ada2 | 2018-09-04 11:28:31 +0100 | [diff] [blame] | 34 | "base/membarrier.cc", |
| 35 | "base/memfd.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 36 | "base/memory_region.cc", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 37 | "base/mem_map.cc", |
Steve Austin | 882ed6b | 2018-06-08 11:40:38 -0700 | [diff] [blame] | 38 | // "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] | 39 | "base/os_linux.cc", |
| 40 | "base/runtime_debug.cc", |
| 41 | "base/safe_copy.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 42 | "base/scoped_arena_allocator.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 43 | "base/scoped_flock.cc", |
Elliott Hughes | c2efd4d | 2018-10-25 13:14:55 -0700 | [diff] [blame] | 44 | "base/socket_peer_is_trusted.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 45 | "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 Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 49 | "base/zip_archive.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 50 | ], |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 51 | target: { |
| 52 | android: { |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 53 | srcs: [ |
| 54 | "base/mem_map_unix.cc", |
| 55 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 56 | static_libs: [ |
| 57 | // ZipArchive support, the order matters here to get all symbols. |
| 58 | "libziparchive", |
| 59 | "libz", |
| 60 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 61 | shared_libs: [ |
| 62 | "liblog", |
| 63 | // For ashmem. |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 64 | "libartpalette", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 65 | // For common macros. |
| 66 | "libbase", |
| 67 | ], |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 68 | export_shared_lib_headers: ["libbase"], |
Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame] | 69 | // Exclude the version script from Darwin host since it's not |
| 70 | // supported by the linker there. That means ASan checks on Darwin |
| 71 | // might trigger ODR violations. |
| 72 | version_script: "libartbase.map", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 73 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 74 | not_windows: { |
| 75 | srcs: [ |
Orion Hodson | cbe6d4a | 2019-05-09 10:29:52 +0100 | [diff] [blame] | 76 | "base/globals_unix.cc", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 77 | "base/mem_map_unix.cc", |
| 78 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 79 | shared_libs: [ |
| 80 | "libziparchive", |
| 81 | "libz", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 82 | "liblog", |
| 83 | // For ashmem. |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 84 | "libartpalette", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 85 | // For common macros. |
| 86 | "libbase", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 87 | ], |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 88 | export_shared_lib_headers: ["libbase"], |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 89 | }, |
Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame] | 90 | linux_glibc: { |
| 91 | version_script: "libartbase.map", |
| 92 | }, |
| 93 | windows: { |
| 94 | version_script: "libartbase.map", |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 95 | srcs: [ |
| 96 | "base/mem_map_windows.cc", |
| 97 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 98 | static_libs: [ |
| 99 | "libziparchive", |
| 100 | "libz", |
| 101 | "liblog", |
| 102 | // For ashmem. |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 103 | "libartpalette", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 104 | // For common macros. |
| 105 | "libbase", |
| 106 | ], |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 107 | export_static_lib_headers: ["libbase"], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 108 | cflags: ["-Wno-thread-safety"], |
Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame] | 109 | }, |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 110 | darwin: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 111 | enabled: true, // for libdexfile. |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 112 | }, |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 113 | }, |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 114 | generated_sources: ["art_libartbase_operator_srcs"], |
| 115 | cflags: ["-DBUILDING_LIBART=1"], |
Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame] | 116 | |
| 117 | // Utilities used by various ART libs and tools are linked in statically |
| 118 | // here to avoid shared lib dependencies outside the ART APEX. No target |
| 119 | // there should depend on these separately. |
| 120 | whole_static_libs: [ |
| 121 | "liblz4", |
| 122 | "liblzma", |
| 123 | ], |
| 124 | |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 125 | export_include_dirs: ["."], |
| 126 | // ART's macros.h depends on libbase's macros.h. |
| 127 | // Note: runtime_options.h depends on cmdline. But we don't really want to export this |
| 128 | // generically. dex2oat takes care of it itself. |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 129 | } |
| 130 | |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 131 | cc_defaults { |
| 132 | name: "libartbase_static_base_defaults", |
| 133 | static_libs: [ |
| 134 | "libbase", |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 135 | "libartpalette", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 136 | "liblog", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 137 | "libz", |
| 138 | "libziparchive", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 139 | ], |
| 140 | } |
| 141 | |
| 142 | cc_defaults { |
| 143 | name: "libartbase_static_defaults", |
| 144 | defaults: ["libartbase_static_base_defaults"], |
| 145 | static_libs: ["libartbase"], |
| 146 | } |
| 147 | |
| 148 | cc_defaults { |
| 149 | name: "libartbased_static_defaults", |
| 150 | defaults: ["libartbase_static_base_defaults"], |
| 151 | static_libs: ["libartbased"], |
| 152 | } |
| 153 | |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 154 | gensrcs { |
| 155 | name: "art_libartbase_operator_srcs", |
| 156 | cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)", |
| 157 | tools: ["generate_operator_out"], |
| 158 | srcs: [ |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 159 | "arch/instruction_set.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 160 | "base/allocator.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 161 | "base/unix_file/fd_file.h", |
| 162 | ], |
| 163 | output_extension: "operator_out.cc", |
| 164 | } |
| 165 | |
| 166 | art_cc_library { |
| 167 | name: "libartbase", |
| 168 | defaults: ["libartbase_defaults"], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 169 | visibility: [ |
| 170 | // TODO(b/133140750): Clean this up. |
| 171 | "//cts/tests/tests/appop", |
| 172 | "//frameworks/base/startop/view_compiler", |
| 173 | "//frameworks/base/tests/net:__subpackages__", |
| 174 | "//packages/modules/NetworkStack/tests:__subpackages__", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 175 | ], |
| 176 | |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 177 | // Leave the symbols in the shared library so that stack unwinders can |
| 178 | // produce meaningful name resolution. |
| 179 | strip: { |
| 180 | keep_symbols: true, |
| 181 | }, |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 182 | shared_libs: [ |
| 183 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 184 | "libziparchive", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 185 | ], |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 186 | export_shared_lib_headers: ["libbase"], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 187 | target: { |
| 188 | windows: { |
| 189 | enabled: true, |
| 190 | shared: { |
| 191 | enabled: false, |
| 192 | }, |
| 193 | }, |
| 194 | }, |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | art_cc_library { |
| 198 | name: "libartbased", |
| 199 | defaults: [ |
| 200 | "art_debug_defaults", |
| 201 | "libartbase_defaults", |
| 202 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 203 | shared_libs: [ |
| 204 | "libbase", |
| 205 | "libziparchive", |
| 206 | ], |
| 207 | export_shared_lib_headers: ["libbase"], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 208 | target: { |
| 209 | windows: { |
| 210 | enabled: true, |
| 211 | shared: { |
| 212 | enabled: false, |
| 213 | }, |
| 214 | }, |
| 215 | }, |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 216 | } |
| 217 | |
David Sehr | d5f8de8 | 2018-04-27 14:12:03 -0700 | [diff] [blame] | 218 | art_cc_library { |
| 219 | name: "libartbase-art-gtest", |
| 220 | defaults: ["libart-gtest-defaults"], |
| 221 | srcs: [ |
| 222 | "base/common_art_test.cc", |
| 223 | ], |
| 224 | shared_libs: [ |
| 225 | "libartbased", |
| 226 | "libdexfiled", |
| 227 | "libbase", |
| 228 | "libbacktrace", |
| 229 | ], |
| 230 | header_libs: [ |
| 231 | "libnativehelper_header_only", |
| 232 | ], |
Alex Light | 5515310 | 2019-05-08 17:03:10 -0700 | [diff] [blame] | 233 | static: { |
| 234 | whole_static_libs: ["libc++fs"], |
| 235 | }, |
| 236 | shared: { |
| 237 | static_libs: ["libc++fs"], |
| 238 | }, |
David Sehr | d5f8de8 | 2018-04-27 14:12:03 -0700 | [diff] [blame] | 239 | } |
| 240 | |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 241 | art_cc_test { |
| 242 | name: "art_libartbase_tests", |
| 243 | defaults: [ |
| 244 | "art_gtest_defaults", |
| 245 | ], |
| 246 | srcs: [ |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 247 | "arch/instruction_set_test.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 248 | "base/arena_allocator_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 249 | "base/bit_field_test.cc", |
David Srbecky | 68fefac | 2018-05-10 17:49:33 +0100 | [diff] [blame] | 250 | "base/bit_memory_region_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 251 | "base/bit_string_test.cc", |
| 252 | "base/bit_struct_test.cc", |
David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 253 | "base/bit_table_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 254 | "base/bit_utils_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 255 | "base/bit_vector_test.cc", |
David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 256 | "base/file_utils_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 257 | "base/hash_set_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 258 | "base/hex_dump_test.cc", |
| 259 | "base/histogram_test.cc", |
David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 260 | "base/indenter_test.cc", |
Vladimir Marko | 3fae129 | 2019-06-07 11:26:25 +0100 | [diff] [blame] | 261 | "base/intrusive_forward_list_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 262 | "base/leb128_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 263 | "base/logging_test.cc", |
Orion Hodson | 563ada2 | 2018-09-04 11:28:31 +0100 | [diff] [blame] | 264 | "base/memfd_test.cc", |
| 265 | "base/membarrier_test.cc", |
David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 266 | "base/memory_region_test.cc", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 267 | "base/mem_map_test.cc", |
Orion Hodson | 077872d | 2019-03-06 11:00:52 +0000 | [diff] [blame] | 268 | "base/memory_type_table_test.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 269 | "base/safe_copy_test.cc", |
| 270 | "base/scoped_flock_test.cc", |
| 271 | "base/time_utils_test.cc", |
| 272 | "base/transform_array_ref_test.cc", |
| 273 | "base/transform_iterator_test.cc", |
| 274 | "base/unix_file/fd_file_test.cc", |
| 275 | "base/utils_test.cc", |
| 276 | "base/variant_map_test.cc", |
David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 277 | "base/zip_archive_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 278 | ], |
| 279 | shared_libs: [ |
| 280 | "libbase", |
| 281 | ], |
| 282 | } |
| 283 | |
| 284 | cc_library_headers { |
| 285 | name: "art_libartbase_headers", |
| 286 | host_supported: true, |
| 287 | export_include_dirs: ["."], |
| 288 | shared_libs: ["libbase"], |
| 289 | export_shared_lib_headers: ["libbase"], |
| 290 | } |