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 | 8f4b056 | 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: [ |
| 22 | "base/allocator.cc", |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 23 | "base/arena_allocator.cc", |
| 24 | "base/arena_bit_vector.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 25 | "base/bit_vector.cc", |
| 26 | "base/file_magic.cc", |
| 27 | "base/hex_dump.cc", |
| 28 | "base/logging.cc", |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 29 | "base/malloc_arena_pool.cc", |
| 30 | "base/memory_region.cc", |
| 31 | "base/mem_map.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 32 | "base/os_linux.cc", |
| 33 | "base/runtime_debug.cc", |
| 34 | "base/safe_copy.cc", |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 35 | "base/scoped_arena_allocator.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 36 | "base/scoped_flock.cc", |
| 37 | "base/time_utils.cc", |
| 38 | "base/unix_file/fd_file.cc", |
| 39 | "base/unix_file/random_access_file_utils.cc", |
| 40 | "base/utils.cc", |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 41 | "base/zip_archive.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 42 | ], |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 43 | target: { |
| 44 | android: { |
| 45 | static_libs: [ |
| 46 | // ZipArchive support, the order matters here to get all symbols. |
| 47 | "libziparchive", |
| 48 | "libz", |
| 49 | ], |
| 50 | shared_libs: [ |
| 51 | // For android::FileMap used by libziparchive. |
| 52 | "libutils", |
| 53 | ], |
| 54 | }, |
| 55 | host: { |
| 56 | shared_libs: [ |
| 57 | "libziparchive", |
| 58 | "libz", |
| 59 | ], |
| 60 | }, |
| 61 | }, |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 62 | generated_sources: ["art_libartbase_operator_srcs"], |
| 63 | cflags: ["-DBUILDING_LIBART=1"], |
| 64 | shared_libs: [ |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 65 | "libbacktrace", |
| 66 | "liblog", |
| 67 | // For ashmem. |
| 68 | "libcutils", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 69 | // For common macros. |
| 70 | "libbase", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 71 | ], |
| 72 | export_include_dirs: ["."], |
| 73 | // ART's macros.h depends on libbase's macros.h. |
| 74 | // Note: runtime_options.h depends on cmdline. But we don't really want to export this |
| 75 | // generically. dex2oat takes care of it itself. |
| 76 | export_shared_lib_headers: ["libbase"], |
| 77 | } |
| 78 | |
| 79 | gensrcs { |
| 80 | name: "art_libartbase_operator_srcs", |
| 81 | cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)", |
| 82 | tools: ["generate_operator_out"], |
| 83 | srcs: [ |
| 84 | "base/allocator.h", |
| 85 | "base/callee_save_type.h", |
| 86 | "base/unix_file/fd_file.h", |
| 87 | ], |
| 88 | output_extension: "operator_out.cc", |
| 89 | } |
| 90 | |
| 91 | art_cc_library { |
| 92 | name: "libartbase", |
| 93 | defaults: ["libartbase_defaults"], |
| 94 | // Leave the symbols in the shared library so that stack unwinders can |
| 95 | // produce meaningful name resolution. |
| 96 | strip: { |
| 97 | keep_symbols: true, |
| 98 | }, |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 99 | shared_libs: [ |
| 100 | "libbase", |
| 101 | "libziparchive", |
| 102 | ], |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 103 | export_shared_lib_headers: ["libbase"], |
| 104 | } |
| 105 | |
| 106 | art_cc_library { |
| 107 | name: "libartbased", |
| 108 | defaults: [ |
| 109 | "art_debug_defaults", |
| 110 | "libartbase_defaults", |
| 111 | ], |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 112 | shared_libs: [ |
| 113 | "libbase", |
| 114 | "libziparchive", |
| 115 | ], |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 116 | export_shared_lib_headers: ["libbase"], |
| 117 | } |
| 118 | |
| 119 | // For now many of these tests still use CommonRuntimeTest, almost universally because of |
| 120 | // ScratchFile and related. |
| 121 | // TODO: Remove CommonRuntimeTest dependency from these tests. |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 122 | art_cc_test { |
| 123 | name: "art_libartbase_tests", |
| 124 | defaults: [ |
| 125 | "art_gtest_defaults", |
| 126 | ], |
| 127 | srcs: [ |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 128 | "base/arena_allocator_test.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 129 | "base/bit_field_test.cc", |
David Srbecky | b68db85 | 2018-05-10 17:49:33 +0100 | [diff] [blame] | 130 | "base/bit_memory_region_test.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 131 | "base/bit_string_test.cc", |
| 132 | "base/bit_struct_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 133 | "base/bit_utils_test.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 134 | "base/bit_vector_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 135 | "base/hash_set_test.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 136 | "base/hex_dump_test.cc", |
| 137 | "base/histogram_test.cc", |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 138 | "base/indenter_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 139 | "base/leb128_test.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 140 | "base/logging_test.cc", |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 141 | "base/memory_region_test.cc", |
| 142 | "base/mem_map_test.cc", |
David Sehr | 8f4b056 | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 143 | "base/safe_copy_test.cc", |
| 144 | "base/scoped_flock_test.cc", |
| 145 | "base/time_utils_test.cc", |
| 146 | "base/transform_array_ref_test.cc", |
| 147 | "base/transform_iterator_test.cc", |
| 148 | "base/unix_file/fd_file_test.cc", |
| 149 | "base/utils_test.cc", |
| 150 | "base/variant_map_test.cc", |
David Sehr | c75f0af | 2018-04-05 11:02:03 -0700 | [diff] [blame] | 151 | "base/zip_archive_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 152 | ], |
| 153 | shared_libs: [ |
| 154 | "libbase", |
| 155 | ], |
| 156 | } |
| 157 | |
| 158 | cc_library_headers { |
| 159 | name: "art_libartbase_headers", |
| 160 | host_supported: true, |
| 161 | export_include_dirs: ["."], |
| 162 | shared_libs: ["libbase"], |
| 163 | export_shared_lib_headers: ["libbase"], |
| 164 | } |