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", |
| 144 | ], |
| 145 | output_extension: "operator_out.cc", |
| 146 | } |
| 147 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 148 | art_cc_library { |
| 149 | name: "libdexfile", |
Christopher Ferris | 0d38e85 | 2019-12-11 09:37:19 -0800 | [diff] [blame] | 150 | defaults: [ |
| 151 | "libdexfile_defaults", |
| 152 | "libart_nativeunwind_defaults", |
| 153 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 154 | target: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 155 | android: { |
| 156 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 157 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 158 | ], |
| 159 | export_shared_lib_headers: [ |
| 160 | "libartbase", |
| 161 | ], |
| 162 | }, |
| 163 | not_windows: { |
| 164 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 165 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 166 | ], |
| 167 | export_shared_lib_headers: [ |
| 168 | "libartbase", |
| 169 | ], |
| 170 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 171 | windows: { |
| 172 | enabled: true, |
| 173 | shared: { |
| 174 | enabled: false, |
| 175 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 176 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 177 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 178 | ], |
| 179 | export_static_lib_headers: [ |
| 180 | "libartbase", |
| 181 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 182 | }, |
| 183 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 184 | apex_available: [ |
| 185 | "com.android.art.release", |
| 186 | "com.android.art.debug", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 187 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 188 | } |
| 189 | |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 190 | art_cc_library { |
| 191 | name: "libdexfiled", |
| 192 | defaults: [ |
| 193 | "art_debug_defaults", |
| 194 | "libdexfile_defaults", |
| 195 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 196 | target: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 197 | android: { |
| 198 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 199 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 200 | ], |
| 201 | export_shared_lib_headers: [ |
| 202 | "libartbased", |
| 203 | ], |
| 204 | }, |
| 205 | not_windows: { |
| 206 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 207 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 208 | ], |
| 209 | export_shared_lib_headers: [ |
| 210 | "libartbased", |
| 211 | ], |
| 212 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 213 | windows: { |
| 214 | enabled: true, |
| 215 | shared: { |
| 216 | enabled: false, |
| 217 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 218 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 219 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 220 | ], |
| 221 | export_static_lib_headers: [ |
| 222 | "libartbased", |
| 223 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 224 | }, |
| 225 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 226 | apex_available: [ |
| 227 | "com.android.art.debug", |
| 228 | ], |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 229 | } |
| 230 | |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 231 | art_cc_test { |
| 232 | name: "art_libdexfile_tests", |
| 233 | defaults: [ |
| 234 | "art_gtest_defaults", |
| 235 | ], |
| 236 | srcs: [ |
| 237 | "dex/art_dex_file_loader_test.cc", |
| 238 | "dex/class_accessor_test.cc", |
| 239 | "dex/code_item_accessors_test.cc", |
| 240 | "dex/compact_dex_file_test.cc", |
| 241 | "dex/compact_offset_table_test.cc", |
| 242 | "dex/descriptors_names_test.cc", |
| 243 | "dex/test_dex_file_builder_test.cc", |
| 244 | "dex/dex_file_loader_test.cc", |
| 245 | "dex/dex_file_verifier_test.cc", |
| 246 | "dex/dex_instruction_test.cc", |
| 247 | "dex/primitive_test.cc", |
| 248 | "dex/string_reference_test.cc", |
| 249 | "dex/type_lookup_table_test.cc", |
| 250 | "dex/utf_test.cc", |
| 251 | ], |
David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 252 | data: [ |
| 253 | ":art-gtest-jars-GetMethodSignature", |
| 254 | ":art-gtest-jars-Lookup", |
| 255 | ":art-gtest-jars-Main", |
| 256 | ":art-gtest-jars-MultiDex", |
| 257 | ":art-gtest-jars-Nested", |
| 258 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 259 | header_libs: ["jni_headers"], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 260 | shared_libs: [ |
| 261 | "libbacktrace", |
| 262 | "libziparchive", |
| 263 | ], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 264 | } |
| 265 | |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 266 | cc_library_headers { |
| 267 | name: "libdexfile_external_headers", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 268 | visibility: ["//visibility:public"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 269 | host_supported: true, |
| 270 | header_libs: ["libbase_headers"], |
| 271 | export_header_lib_headers: ["libbase_headers"], |
| 272 | export_include_dirs: ["external/include"], |
| 273 | |
| 274 | target: { |
| 275 | windows: { |
| 276 | enabled: true, |
| 277 | }, |
| 278 | }, |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 279 | |
| 280 | apex_available: [ |
| 281 | "//apex_available:platform", |
| 282 | "com.android.art.debug", |
| 283 | "com.android.art.release", |
| 284 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 285 | } |
| 286 | |
Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 287 | // Make dex_instruction_list.h available for tools/jvmti-agents/titrace |
| 288 | cc_library_headers { |
| 289 | name: "libdexfile_all_headers", |
| 290 | visibility: ["//art:__subpackages__"], |
| 291 | host_supported: true, |
| 292 | export_include_dirs: ["."], |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 293 | |
| 294 | apex_available: [ |
| 295 | "com.android.art.debug", |
| 296 | "com.android.art.release", |
| 297 | ], |
Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 298 | } |
| 299 | |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 300 | cc_defaults { |
| 301 | name: "libdexfile_external-defaults", |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 302 | host_supported: true, |
| 303 | srcs: [ |
| 304 | "external/dex_file_ext.cc", |
| 305 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 306 | header_libs: [ |
| 307 | "jni_headers", |
| 308 | "libdexfile_external_headers", |
| 309 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 310 | shared_libs: [ |
| 311 | "libbase", |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 312 | ], |
Martin Stjernholm | 84bf698 | 2019-02-05 15:07:57 +0000 | [diff] [blame] | 313 | stubs: { |
| 314 | symbol_file: "external/libdexfile_external.map.txt", |
| 315 | versions: ["1"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 316 | }, |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 317 | export_header_lib_headers: [ |
| 318 | "jni_headers", |
| 319 | "libdexfile_external_headers", |
| 320 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 321 | } |
| 322 | |
David Srbecky | 1cf46a3 | 2020-06-22 15:39:00 +0100 | [diff] [blame] | 323 | art_cc_library { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 324 | name: "libdexfile_external", |
| 325 | defaults: [ |
| 326 | "art_defaults", |
| 327 | "libdexfile_external-defaults", |
| 328 | ], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 329 | visibility: ["//visibility:public"], |
David Srbecky | 52fc7ab | 2019-05-03 11:03:52 +0100 | [diff] [blame] | 330 | target: { |
| 331 | darwin: { |
| 332 | enabled: true, |
| 333 | }, |
| 334 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 335 | shared_libs: [ |
| 336 | "libdexfile", |
| 337 | ], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 338 | apex_available: [ |
| 339 | "com.android.art.release", |
| 340 | "com.android.art.debug", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 341 | ], |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 342 | } |
| 343 | |
David Srbecky | 1cf46a3 | 2020-06-22 15:39:00 +0100 | [diff] [blame] | 344 | art_cc_library { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 345 | name: "libdexfiled_external", |
| 346 | defaults: [ |
| 347 | "art_debug_defaults", |
| 348 | "libdexfile_external-defaults", |
| 349 | ], |
David Srbecky | 52fc7ab | 2019-05-03 11:03:52 +0100 | [diff] [blame] | 350 | target: { |
| 351 | darwin: { |
| 352 | enabled: true, |
| 353 | }, |
| 354 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 355 | shared_libs: [ |
| 356 | "libdexfiled", |
| 357 | ], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 358 | apex_available: [ |
| 359 | "com.android.art.debug", |
| 360 | ], |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 361 | } |
| 362 | |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 363 | art_cc_test { |
| 364 | name: "art_libdexfile_external_tests", |
| 365 | host_supported: true, |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 366 | test_suites: ["general-tests"], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 367 | srcs: [ |
| 368 | "external/dex_file_ext_c_test.c", |
| 369 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 370 | header_libs: [ |
| 371 | "jni_headers", |
| 372 | "libdexfile_external_headers", |
| 373 | ], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 374 | } |
| 375 | |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 376 | // 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] | 377 | // (non-ART) users. |
| 378 | // |
| 379 | // This library dlopens libdexfile_external on first use, so there is no build |
| 380 | // time dependency on dex file logic. It is therefore safe to use from binaries |
| 381 | // compiled without dex file support, given they won't encounter any dex file |
| 382 | // stack frames. |
David Srbecky | 1cf46a3 | 2020-06-22 15:39:00 +0100 | [diff] [blame] | 383 | art_cc_library { |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 384 | name: "libdexfile_support", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 385 | visibility: ["//visibility:public"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 386 | host_supported: true, |
| 387 | srcs: [ |
| 388 | "external/dex_file_supp.cc", |
| 389 | ], |
Martin Stjernholm | 8089204 | 2020-04-21 00:39:00 +0100 | [diff] [blame] | 390 | runtime_libs: ["libdexfile_external"], |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 391 | shared_libs: ["liblog"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 392 | header_libs: ["libdexfile_external_headers"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 393 | export_header_lib_headers: ["libdexfile_external_headers"], |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 394 | |
| 395 | apex_available: [ |
| 396 | "//apex_available:platform", |
| 397 | "com.android.art.debug", |
| 398 | "com.android.art.release", |
| 399 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 400 | } |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 401 | |
David Srbecky | 883c134 | 2020-05-11 23:30:29 +0000 | [diff] [blame] | 402 | // The same source file is used in two tests here. |
| 403 | // 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] | 404 | art_cc_test { |
| 405 | name: "art_libdexfile_support_tests", |
Roland Levillain | 61f0716 | 2019-06-26 12:44:04 +0100 | [diff] [blame] | 406 | defaults: [ |
| 407 | "art_test_defaults", |
| 408 | ], |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 409 | host_supported: true, |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 410 | test_suites: ["general-tests"], |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 411 | srcs: [ |
| 412 | "external/dex_file_supp_test.cc", |
| 413 | ], |
| 414 | shared_libs: [ |
| 415 | "libartbase", |
| 416 | "libbase", |
| 417 | "libdexfile_external", |
| 418 | "libdexfile_support", |
| 419 | ], |
| 420 | } |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 421 | |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 422 | cc_defaults { |
| 423 | name: "libdexfile_support_static_defaults", |
Martin Stjernholm | d3ee98a | 2019-09-23 16:26:50 +0100 | [diff] [blame] | 424 | host_supported: true, |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 425 | srcs: [ |
| 426 | "external/dex_file_supp.cc", |
| 427 | ], |
| 428 | cflags: ["-DSTATIC_LIB"], |
Orion Hodson | 26ab270 | 2020-07-29 09:54:10 +0100 | [diff] [blame] | 429 | // Using whole_static_libs here only as an "approximate transitivity" kludge. |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 430 | whole_static_libs: [ |
| 431 | "libbase", |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 432 | "liblog", |
| 433 | "libz", |
| 434 | "libziparchive", |
| 435 | ], |
| 436 | header_libs: ["libdexfile_external_headers"], |
| 437 | export_header_lib_headers: ["libdexfile_external_headers"], |
| 438 | } |
| 439 | |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 440 | cc_library_static { |
| 441 | name: "libdexfile_support_static", |
| 442 | visibility: [ |
| 443 | "//art:__subpackages__", |
Martin Stjernholm | 2d18719 | 2019-10-23 21:52:29 +0100 | [diff] [blame] | 444 | // Required for the simpleperf binary in the NDK. No other modules than |
| 445 | // //system/extras/simpleperf:simpleperf_ndk are allowed to use it. |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 446 | "//system/extras/simpleperf", |
Dan Willemsen | 3255f50 | 2020-06-04 16:29:36 -0700 | [diff] [blame] | 447 | "//cts/tests/tests/simpleperf", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 448 | ], |
| 449 | defaults: [ |
| 450 | "libdexfile_static_defaults", |
| 451 | "libdexfile_support_static_defaults", |
| 452 | ], |
| 453 | whole_static_libs: [ |
| 454 | "libdexfile", |
| 455 | "libdexfile_external", |
| 456 | ], |
| 457 | } |
| 458 | |
| 459 | cc_library_static { |
| 460 | name: "libdexfiled_support_static", |
| 461 | defaults: [ |
| 462 | "libdexfile_support_static_defaults", |
| 463 | "libdexfiled_static_defaults", |
| 464 | ], |
| 465 | whole_static_libs: [ |
| 466 | "libdexfiled", |
| 467 | "libdexfiled_external", |
| 468 | ], |
| 469 | } |
| 470 | |
David Srbecky | 883c134 | 2020-05-11 23:30:29 +0000 | [diff] [blame] | 471 | // The same source file is used in two tests here. |
| 472 | // 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] | 473 | art_cc_test { |
| 474 | name: "art_libdexfile_support_static_tests", |
| 475 | host_supported: true, |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 476 | test_suites: ["general-tests"], |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 477 | srcs: [ |
| 478 | "external/dex_file_supp_test.cc", |
| 479 | ], |
| 480 | static_libs: [ |
| 481 | "libbase", |
| 482 | "libdexfile_support_static", |
| 483 | ], |
| 484 | } |