| 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", |
| 27 | "base/file_magic.cc", |
| David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 28 | "base/file_utils.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 29 | "base/hex_dump.cc", |
| 30 | "base/logging.cc", |
| David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 31 | "base/malloc_arena_pool.cc", |
| Orion Hodson | 563ada2 | 2018-09-04 11:28:31 +0100 | [diff] [blame] | 32 | "base/membarrier.cc", |
| 33 | "base/memfd.cc", |
| David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 34 | "base/memory_region.cc", |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 35 | "base/mem_map.cc", |
| Steve Austin | 882ed6b | 2018-06-08 11:40:38 -0700 | [diff] [blame] | 36 | // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong |
| 37 | "base/mem_map_unix.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 38 | "base/os_linux.cc", |
| 39 | "base/runtime_debug.cc", |
| 40 | "base/safe_copy.cc", |
| David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 41 | "base/scoped_arena_allocator.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 42 | "base/scoped_flock.cc", |
| Elliott Hughes | c2efd4d | 2018-10-25 13:14:55 -0700 | [diff] [blame] | 43 | "base/socket_peer_is_trusted.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 44 | "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 Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 48 | "base/zip_archive.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 49 | ], |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 50 | target: { |
| 51 | android: { |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 52 | static_libs: [ |
| 53 | // ZipArchive support, the order matters here to get all symbols. |
| 54 | "libziparchive", |
| 55 | "libz", |
| 56 | ], |
| Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame^] | 57 | // 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 Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 61 | }, |
| 62 | host: { |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 63 | shared_libs: [ |
| 64 | "libziparchive", |
| 65 | "libz", |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 66 | ], |
| 67 | }, |
| Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame^] | 68 | linux_glibc: { |
| 69 | version_script: "libartbase.map", |
| 70 | }, |
| 71 | windows: { |
| 72 | version_script: "libartbase.map", |
| 73 | }, |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 74 | }, |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 75 | generated_sources: ["art_libartbase_operator_srcs"], |
| 76 | cflags: ["-DBUILDING_LIBART=1"], |
| 77 | shared_libs: [ |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 78 | "liblog", |
| Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame^] | 79 | // For ashmem. |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 80 | "libcutils", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 81 | // For common macros. |
| 82 | "libbase", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 83 | ], |
| Martin Stjernholm | 4355162 | 2018-11-09 15:14:54 +0000 | [diff] [blame^] | 84 | |
| 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 Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 93 | 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 Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 100 | cc_defaults { |
| 101 | name: "libartbase_static_base_defaults", |
| 102 | static_libs: [ |
| 103 | "libbase", |
| 104 | "libcutils", |
| 105 | "liblog", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 106 | "libz", |
| 107 | "libziparchive", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 108 | ], |
| 109 | } |
| 110 | |
| 111 | cc_defaults { |
| 112 | name: "libartbase_static_defaults", |
| 113 | defaults: ["libartbase_static_base_defaults"], |
| 114 | static_libs: ["libartbase"], |
| 115 | } |
| 116 | |
| 117 | cc_defaults { |
| 118 | name: "libartbased_static_defaults", |
| 119 | defaults: ["libartbase_static_base_defaults"], |
| 120 | static_libs: ["libartbased"], |
| 121 | } |
| 122 | |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 123 | gensrcs { |
| 124 | name: "art_libartbase_operator_srcs", |
| 125 | cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)", |
| 126 | tools: ["generate_operator_out"], |
| 127 | srcs: [ |
| David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 128 | "arch/instruction_set.h", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 129 | "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 | |
| 136 | art_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 Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 144 | shared_libs: [ |
| 145 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 146 | "libziparchive", |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 147 | ], |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 148 | export_shared_lib_headers: ["libbase"], |
| 149 | } |
| 150 | |
| 151 | art_cc_library { |
| 152 | name: "libartbased", |
| 153 | defaults: [ |
| 154 | "art_debug_defaults", |
| 155 | "libartbase_defaults", |
| 156 | ], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 157 | shared_libs: [ |
| 158 | "libbase", |
| 159 | "libziparchive", |
| 160 | ], |
| 161 | export_shared_lib_headers: ["libbase"], |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 162 | } |
| 163 | |
| David Sehr | d5f8de8 | 2018-04-27 14:12:03 -0700 | [diff] [blame] | 164 | art_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 Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 184 | art_cc_test { |
| 185 | name: "art_libartbase_tests", |
| 186 | defaults: [ |
| 187 | "art_gtest_defaults", |
| 188 | ], |
| 189 | srcs: [ |
| David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 190 | "arch/instruction_set_test.cc", |
| David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 191 | "base/arena_allocator_test.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 192 | "base/bit_field_test.cc", |
| David Srbecky | 68fefac | 2018-05-10 17:49:33 +0100 | [diff] [blame] | 193 | "base/bit_memory_region_test.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 194 | "base/bit_string_test.cc", |
| 195 | "base/bit_struct_test.cc", |
| David Srbecky | 052f8ca | 2018-04-26 15:42:54 +0100 | [diff] [blame] | 196 | "base/bit_table_test.cc", |
| David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 197 | "base/bit_utils_test.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 198 | "base/bit_vector_test.cc", |
| David Sehr | c3e1895 | 2018-05-11 16:59:31 -0700 | [diff] [blame] | 199 | "base/file_utils_test.cc", |
| David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 200 | "base/hash_set_test.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 201 | "base/hex_dump_test.cc", |
| 202 | "base/histogram_test.cc", |
| David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 203 | "base/indenter_test.cc", |
| David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 204 | "base/leb128_test.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 205 | "base/logging_test.cc", |
| Orion Hodson | 563ada2 | 2018-09-04 11:28:31 +0100 | [diff] [blame] | 206 | "base/memfd_test.cc", |
| 207 | "base/membarrier_test.cc", |
| David Sehr | 1ce2b3b | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 208 | "base/memory_region_test.cc", |
| David Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 209 | "base/mem_map_test.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 210 | "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 Sehr | 79e2607 | 2018-04-06 17:58:50 -0700 | [diff] [blame] | 218 | "base/zip_archive_test.cc", |
| David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 219 | ], |
| 220 | shared_libs: [ |
| 221 | "libbase", |
| 222 | ], |
| 223 | } |
| 224 | |
| 225 | cc_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 | } |