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