| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -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 | |
| 17 | cc_defaults { |
| 18 | name: "libdexfile_defaults", |
| 19 | defaults: ["art_defaults"], |
| Martin Stjernholm | 75b961a | 2020-05-07 01:45:27 +0100 | [diff] [blame] | 20 | visibility: [ |
| 21 | // Visibility for prebuilt dex2oat(d) 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 | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 26 | host_supported: true, |
| 27 | srcs: [ |
| David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 28 | "dex/art_dex_file_loader.cc", |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 29 | "dex/compact_dex_file.cc", |
| Mathieu Chartier | 5e3cfa2 | 2018-02-20 16:53:37 -0800 | [diff] [blame] | 30 | "dex/compact_offset_table.cc", |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 31 | "dex/descriptors_names.cc", |
| 32 | "dex/dex_file.cc", |
| 33 | "dex/dex_file_exception_helpers.cc", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 34 | "dex/dex_file_layout.cc", |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 35 | "dex/dex_file_loader.cc", |
| 36 | "dex/dex_file_tracking_registrar.cc", |
| 37 | "dex/dex_file_verifier.cc", |
| 38 | "dex/dex_instruction.cc", |
| 39 | "dex/modifiers.cc", |
| David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 40 | "dex/primitive.cc", |
| Andreas Gampe | ad1aa63 | 2019-01-02 10:30:54 -0800 | [diff] [blame] | 41 | "dex/signature.cc", |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 42 | "dex/standard_dex_file.cc", |
| David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 43 | "dex/type_lookup_table.cc", |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 44 | "dex/utf.cc", |
| 45 | ], |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 46 | header_libs: ["jni_headers"], |
| 47 | export_header_lib_headers: ["jni_headers"], |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 48 | target: { |
| 49 | android: { |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 50 | static_libs: [ |
| 51 | "libziparchive", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 52 | ], |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 53 | shared_libs: [ |
| Jiyong Park | b1c8e16 | 2020-05-18 19:04:42 +0900 | [diff] [blame^] | 54 | // libz provides a stub from platform, shouldn't be statically linked |
| 55 | "libz", |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 56 | // For MemMap. |
| 57 | "libartpalette", |
| 58 | "liblog", |
| 59 | // For common macros. |
| 60 | "libbase", |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 61 | ], |
| 62 | export_shared_lib_headers: [ |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 63 | "libbase", |
| 64 | ], |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 65 | }, |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 66 | not_windows: { |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 67 | shared_libs: [ |
| 68 | "libziparchive", |
| 69 | "libz", |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 70 | // For MemMap. |
| 71 | "libartpalette", |
| 72 | "liblog", |
| 73 | // For common macros. |
| 74 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 75 | ], |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 76 | export_shared_lib_headers: [ |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 77 | "libbase", |
| 78 | ], |
| 79 | }, |
| 80 | windows: { |
| 81 | static_libs: [ |
| 82 | "libziparchive", |
| 83 | "libz", |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 84 | // For MemMap. |
| 85 | "libartpalette", |
| 86 | "liblog", |
| 87 | // For common macros. |
| 88 | "libbase", |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 89 | ], |
| 90 | export_static_lib_headers: [ |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 91 | "libbase", |
| 92 | ], |
| 93 | cflags: ["-Wno-thread-safety"], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 94 | }, |
| David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 95 | darwin: { |
| 96 | enabled: true, |
| 97 | }, |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 98 | }, |
| 99 | generated_sources: ["dexfile_operator_srcs"], |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 100 | export_include_dirs: ["."], |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 101 | } |
| 102 | |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 103 | cc_defaults { |
| 104 | name: "libdexfile_static_base_defaults", |
| 105 | static_libs: [ |
| 106 | "libbase", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 107 | "liblog", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 108 | "libz", |
| 109 | "libziparchive", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 110 | ], |
| 111 | } |
| 112 | |
| 113 | cc_defaults { |
| 114 | name: "libdexfile_static_defaults", |
| 115 | defaults: [ |
| 116 | "libartbase_static_defaults", |
| 117 | "libdexfile_static_base_defaults", |
| 118 | ], |
| Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 119 | defaults_visibility: [ |
| 120 | "//art:__subpackages__", |
| Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 121 | ], |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 122 | static_libs: ["libdexfile"], |
| 123 | } |
| 124 | |
| 125 | cc_defaults { |
| 126 | name: "libdexfiled_static_defaults", |
| 127 | defaults: [ |
| 128 | "libartbased_static_defaults", |
| 129 | "libdexfile_static_base_defaults", |
| 130 | ], |
| 131 | static_libs: ["libdexfiled"], |
| 132 | } |
| 133 | |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 134 | gensrcs { |
| 135 | name: "dexfile_operator_srcs", |
| Alex Light | b69d2d3 | 2018-02-21 13:37:17 -0800 | [diff] [blame] | 136 | cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)", |
| 137 | tools: ["generate_operator_out"], |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 138 | srcs: [ |
| 139 | "dex/dex_file.h", |
| David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 140 | "dex/dex_file_layout.h", |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 141 | "dex/dex_instruction.h", |
| 142 | "dex/dex_instruction_utils.h", |
| 143 | "dex/invoke_type.h", |
| David Sehr | 312f3b2 | 2018-03-19 08:39:26 -0700 | [diff] [blame] | 144 | "dex/method_reference.h", |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 145 | ], |
| 146 | output_extension: "operator_out.cc", |
| 147 | } |
| 148 | |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 149 | art_cc_library { |
| 150 | name: "libdexfile", |
| Christopher Ferris | 0d38e85 | 2019-12-11 09:37:19 -0800 | [diff] [blame] | 151 | defaults: [ |
| 152 | "libdexfile_defaults", |
| 153 | "libart_nativeunwind_defaults", |
| 154 | ], |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 155 | target: { |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 156 | android: { |
| 157 | shared_libs: [ |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 158 | "libartbase", |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 159 | ], |
| 160 | export_shared_lib_headers: [ |
| 161 | "libartbase", |
| 162 | ], |
| 163 | }, |
| 164 | not_windows: { |
| 165 | shared_libs: [ |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 166 | "libartbase", |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 167 | ], |
| 168 | export_shared_lib_headers: [ |
| 169 | "libartbase", |
| 170 | ], |
| 171 | }, |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 172 | windows: { |
| 173 | enabled: true, |
| 174 | shared: { |
| 175 | enabled: false, |
| 176 | }, |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 177 | static_libs: [ |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 178 | "libartbase", |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 179 | ], |
| 180 | export_static_lib_headers: [ |
| 181 | "libartbase", |
| 182 | ], |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 183 | }, |
| 184 | }, |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 185 | apex_available: [ |
| 186 | "com.android.art.release", |
| 187 | "com.android.art.debug", |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 188 | ], |
| David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 189 | } |
| 190 | |
| David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 191 | art_cc_library { |
| 192 | name: "libdexfiled", |
| 193 | defaults: [ |
| 194 | "art_debug_defaults", |
| 195 | "libdexfile_defaults", |
| 196 | ], |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 197 | target: { |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 198 | android: { |
| 199 | shared_libs: [ |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 200 | "libartbased", |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 201 | ], |
| 202 | export_shared_lib_headers: [ |
| 203 | "libartbased", |
| 204 | ], |
| 205 | }, |
| 206 | not_windows: { |
| 207 | shared_libs: [ |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 208 | "libartbased", |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 209 | ], |
| 210 | export_shared_lib_headers: [ |
| 211 | "libartbased", |
| 212 | ], |
| 213 | }, |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 214 | windows: { |
| 215 | enabled: true, |
| 216 | shared: { |
| 217 | enabled: false, |
| 218 | }, |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 219 | static_libs: [ |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 220 | "libartbased", |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 221 | ], |
| 222 | export_static_lib_headers: [ |
| 223 | "libartbased", |
| 224 | ], |
| David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 225 | }, |
| 226 | }, |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 227 | apex_available: [ |
| 228 | "com.android.art.debug", |
| 229 | ], |
| David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 230 | } |
| 231 | |
| Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 232 | art_cc_test { |
| 233 | name: "art_libdexfile_tests", |
| 234 | defaults: [ |
| 235 | "art_gtest_defaults", |
| 236 | ], |
| 237 | srcs: [ |
| 238 | "dex/art_dex_file_loader_test.cc", |
| 239 | "dex/class_accessor_test.cc", |
| 240 | "dex/code_item_accessors_test.cc", |
| 241 | "dex/compact_dex_file_test.cc", |
| 242 | "dex/compact_offset_table_test.cc", |
| 243 | "dex/descriptors_names_test.cc", |
| 244 | "dex/test_dex_file_builder_test.cc", |
| 245 | "dex/dex_file_loader_test.cc", |
| 246 | "dex/dex_file_verifier_test.cc", |
| 247 | "dex/dex_instruction_test.cc", |
| 248 | "dex/primitive_test.cc", |
| 249 | "dex/string_reference_test.cc", |
| 250 | "dex/type_lookup_table_test.cc", |
| 251 | "dex/utf_test.cc", |
| 252 | ], |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 253 | header_libs: ["jni_headers"], |
| Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 254 | shared_libs: [ |
| 255 | "libbacktrace", |
| 256 | "libziparchive", |
| 257 | ], |
| Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 258 | } |
| 259 | |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 260 | cc_library_headers { |
| 261 | name: "libdexfile_external_headers", |
| Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 262 | visibility: ["//visibility:public"], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 263 | host_supported: true, |
| 264 | header_libs: ["libbase_headers"], |
| 265 | export_header_lib_headers: ["libbase_headers"], |
| 266 | export_include_dirs: ["external/include"], |
| 267 | |
| 268 | target: { |
| 269 | windows: { |
| 270 | enabled: true, |
| 271 | }, |
| 272 | }, |
| Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 273 | |
| 274 | apex_available: [ |
| 275 | "//apex_available:platform", |
| 276 | "com.android.art.debug", |
| 277 | "com.android.art.release", |
| 278 | ], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 279 | } |
| 280 | |
| Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 281 | // Make dex_instruction_list.h available for tools/jvmti-agents/titrace |
| 282 | cc_library_headers { |
| 283 | name: "libdexfile_all_headers", |
| 284 | visibility: ["//art:__subpackages__"], |
| 285 | host_supported: true, |
| 286 | export_include_dirs: ["."], |
| Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 287 | |
| 288 | apex_available: [ |
| 289 | "com.android.art.debug", |
| 290 | "com.android.art.release", |
| 291 | ], |
| Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 292 | } |
| 293 | |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 294 | cc_defaults { |
| 295 | name: "libdexfile_external-defaults", |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 296 | host_supported: true, |
| 297 | srcs: [ |
| 298 | "external/dex_file_ext.cc", |
| 299 | ], |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 300 | header_libs: [ |
| 301 | "jni_headers", |
| 302 | "libdexfile_external_headers", |
| 303 | ], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 304 | shared_libs: [ |
| 305 | "libbase", |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 306 | ], |
| Martin Stjernholm | 84bf698 | 2019-02-05 15:07:57 +0000 | [diff] [blame] | 307 | stubs: { |
| 308 | symbol_file: "external/libdexfile_external.map.txt", |
| 309 | versions: ["1"], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 310 | }, |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 311 | export_header_lib_headers: [ |
| 312 | "jni_headers", |
| 313 | "libdexfile_external_headers", |
| 314 | ], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 315 | } |
| 316 | |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 317 | cc_library { |
| 318 | name: "libdexfile_external", |
| 319 | defaults: [ |
| 320 | "art_defaults", |
| 321 | "libdexfile_external-defaults", |
| 322 | ], |
| Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 323 | visibility: ["//visibility:public"], |
| David Srbecky | 52fc7ab | 2019-05-03 11:03:52 +0100 | [diff] [blame] | 324 | target: { |
| 325 | darwin: { |
| 326 | enabled: true, |
| 327 | }, |
| 328 | }, |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 329 | shared_libs: [ |
| 330 | "libdexfile", |
| 331 | ], |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 332 | apex_available: [ |
| 333 | "com.android.art.release", |
| 334 | "com.android.art.debug", |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 335 | ], |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | cc_library { |
| 339 | name: "libdexfiled_external", |
| 340 | defaults: [ |
| 341 | "art_debug_defaults", |
| 342 | "libdexfile_external-defaults", |
| 343 | ], |
| David Srbecky | 52fc7ab | 2019-05-03 11:03:52 +0100 | [diff] [blame] | 344 | target: { |
| 345 | darwin: { |
| 346 | enabled: true, |
| 347 | }, |
| 348 | }, |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 349 | shared_libs: [ |
| 350 | "libdexfiled", |
| 351 | ], |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 352 | apex_available: [ |
| 353 | "com.android.art.debug", |
| 354 | ], |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 355 | } |
| 356 | |
| Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 357 | art_cc_test { |
| 358 | name: "art_libdexfile_external_tests", |
| 359 | host_supported: true, |
| Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 360 | test_suites: ["general-tests"], |
| Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 361 | srcs: [ |
| 362 | "external/dex_file_ext_c_test.c", |
| 363 | ], |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 364 | header_libs: [ |
| 365 | "jni_headers", |
| 366 | "libdexfile_external_headers", |
| 367 | ], |
| Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 368 | } |
| 369 | |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 370 | // Support library with a C++ API for accessing the libdexfile API for external |
| Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 371 | // (non-ART) users. |
| 372 | // |
| 373 | // This library dlopens libdexfile_external on first use, so there is no build |
| 374 | // time dependency on dex file logic. It is therefore safe to use from binaries |
| 375 | // compiled without dex file support, given they won't encounter any dex file |
| 376 | // stack frames. |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 377 | cc_library { |
| 378 | name: "libdexfile_support", |
| Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 379 | visibility: ["//visibility:public"], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 380 | host_supported: true, |
| 381 | srcs: [ |
| 382 | "external/dex_file_supp.cc", |
| 383 | ], |
| Martin Stjernholm | 8089204 | 2020-04-21 00:39:00 +0100 | [diff] [blame] | 384 | runtime_libs: ["libdexfile_external"], |
| Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 385 | shared_libs: ["liblog"], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 386 | header_libs: ["libdexfile_external_headers"], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 387 | export_header_lib_headers: ["libdexfile_external_headers"], |
| Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 388 | |
| 389 | apex_available: [ |
| 390 | "//apex_available:platform", |
| 391 | "com.android.art.debug", |
| 392 | "com.android.art.release", |
| 393 | ], |
| Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 394 | } |
| Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 395 | |
| David Srbecky | 883c134 | 2020-05-11 23:30:29 +0000 | [diff] [blame] | 396 | // The same source file is used in two tests here. |
| 397 | // Its test target is test-art-{host,target}-gtest-art_libdexfile_support_tests. |
| Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 398 | art_cc_test { |
| 399 | name: "art_libdexfile_support_tests", |
| Roland Levillain | 61f0716 | 2019-06-26 12:44:04 +0100 | [diff] [blame] | 400 | defaults: [ |
| 401 | "art_test_defaults", |
| 402 | ], |
| Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 403 | host_supported: true, |
| Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 404 | test_suites: ["general-tests"], |
| Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 405 | srcs: [ |
| 406 | "external/dex_file_supp_test.cc", |
| 407 | ], |
| 408 | shared_libs: [ |
| 409 | "libartbase", |
| 410 | "libbase", |
| 411 | "libdexfile_external", |
| 412 | "libdexfile_support", |
| 413 | ], |
| 414 | } |
| Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 415 | |
| Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 416 | cc_defaults { |
| 417 | name: "libdexfile_support_static_defaults", |
| Martin Stjernholm | d3ee98a | 2019-09-23 16:26:50 +0100 | [diff] [blame] | 418 | host_supported: true, |
| Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 419 | srcs: [ |
| 420 | "external/dex_file_supp.cc", |
| 421 | ], |
| 422 | cflags: ["-DSTATIC_LIB"], |
| 423 | // Using whole_static_libs here only as a "poor man's transitivity" kludge. |
| 424 | whole_static_libs: [ |
| 425 | "libbase", |
| Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 426 | "liblog", |
| 427 | "libz", |
| 428 | "libziparchive", |
| 429 | ], |
| 430 | header_libs: ["libdexfile_external_headers"], |
| 431 | export_header_lib_headers: ["libdexfile_external_headers"], |
| 432 | } |
| 433 | |
| Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 434 | cc_library_static { |
| 435 | name: "libdexfile_support_static", |
| 436 | visibility: [ |
| 437 | "//art:__subpackages__", |
| Martin Stjernholm | 2d18719 | 2019-10-23 21:52:29 +0100 | [diff] [blame] | 438 | // Required for the simpleperf binary in the NDK. No other modules than |
| 439 | // //system/extras/simpleperf:simpleperf_ndk are allowed to use it. |
| Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 440 | "//system/extras/simpleperf", |
| 441 | ], |
| 442 | defaults: [ |
| 443 | "libdexfile_static_defaults", |
| 444 | "libdexfile_support_static_defaults", |
| 445 | ], |
| 446 | whole_static_libs: [ |
| 447 | "libdexfile", |
| 448 | "libdexfile_external", |
| 449 | ], |
| 450 | } |
| 451 | |
| 452 | cc_library_static { |
| 453 | name: "libdexfiled_support_static", |
| 454 | defaults: [ |
| 455 | "libdexfile_support_static_defaults", |
| 456 | "libdexfiled_static_defaults", |
| 457 | ], |
| 458 | whole_static_libs: [ |
| 459 | "libdexfiled", |
| 460 | "libdexfiled_external", |
| 461 | ], |
| 462 | } |
| 463 | |
| David Srbecky | 883c134 | 2020-05-11 23:30:29 +0000 | [diff] [blame] | 464 | // The same source file is used in two tests here. |
| 465 | // Its test target is test-art-{host,target}-gtest-art_libdexfile_support_static_tests. |
| Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 466 | art_cc_test { |
| 467 | name: "art_libdexfile_support_static_tests", |
| 468 | host_supported: true, |
| Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 469 | test_suites: ["general-tests"], |
| Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 470 | srcs: [ |
| 471 | "external/dex_file_supp_test.cc", |
| 472 | ], |
| 473 | static_libs: [ |
| 474 | "libbase", |
| 475 | "libdexfile_support_static", |
| 476 | ], |
| 477 | } |